fix: resolve ts errors for build and cleanup widget partners action

This commit is contained in:
AyrisAI
2026-07-13 14:25:28 +03:00
parent 53cbee0841
commit f37d2b4c39
6 changed files with 37 additions and 176 deletions
+3 -21
View File
@@ -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 }
}