fix: resolve ts errors for build and cleanup widget partners action
This commit is contained in:
+3
-21
@@ -96,6 +96,7 @@ export async function approveSubmissionAction(id: string) {
|
||||
rating: 5.0,
|
||||
isLocalApproved: false,
|
||||
isFeatured: false,
|
||||
hasWidgetInstalled: false,
|
||||
images: submission.imageUrl ? [submission.imageUrl] : []
|
||||
})
|
||||
|
||||
@@ -237,7 +238,8 @@ export async function createOrUpdateListingAction(formData: FormData) {
|
||||
latitude,
|
||||
longitude,
|
||||
openingHours,
|
||||
images
|
||||
images,
|
||||
hasWidgetInstalled: false
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -643,23 +645,3 @@ export async function searchListingsAction(query: string) {
|
||||
}))
|
||||
}
|
||||
|
||||
export async function saveWidgetPartnerAction(formData: FormData) {
|
||||
const id = formData.get('id') as string | null
|
||||
const name = formData.get('name') as string
|
||||
const logoUrl = formData.get('logoUrl') as string
|
||||
const websiteUrl = formData.get('websiteUrl') as string
|
||||
const widgetType = formData.get('widgetType') as string
|
||||
|
||||
if (!name || !logoUrl || !websiteUrl) {
|
||||
return { error: 'Lütfen zorunlu alanları doldurun.' }
|
||||
}
|
||||
|
||||
if (id) {
|
||||
await mockDb.updateWidgetPartner(id, { name, logoUrl, websiteUrl, widgetType })
|
||||
} else {
|
||||
await mockDb.createWidgetPartner({ name, logoUrl, websiteUrl, widgetType })
|
||||
}
|
||||
|
||||
revalidatePath('/admin/widget-partners')
|
||||
return { success: true, error: undefined }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user