diff --git a/app/api/listings/route.ts b/app/api/listings/route.ts index 2017f1f..ef5019b 100644 --- a/app/api/listings/route.ts +++ b/app/api/listings/route.ts @@ -202,6 +202,7 @@ export async function POST(req: Request) { const priceHintPerNightEuros = body.priceHintPerNightEuros !== undefined && body.priceHintPerNightEuros !== null && body.priceHintPerNightEuros !== '' ? Math.round(Number(body.priceHintPerNightEuros)) : null; const calendarUrls = normalizeCalendarUrls(body.calendarUrls); const translationsInputRaw = Array.isArray(body.translations) ? body.translations : []; + type TranslationInput = { locale: string; title: string; description: string; teaser: string | null; slug: string }; const translationsInput = translationsInputRaw .map((item: any) => ({ @@ -332,7 +333,7 @@ export async function POST(req: Request) { published: status === ListingStatus.PUBLISHED, isSample, translations: { - create: translationsInput.map((t) => ({ + create: translationsInput.map((t: TranslationInput) => ({ locale: t.locale, slug: t.slug || slug, title: t.title, diff --git a/app/listings/new/page.tsx b/app/listings/new/page.tsx index fa659cd..c80cc32 100644 --- a/app/listings/new/page.tsx +++ b/app/listings/new/page.tsx @@ -357,7 +357,13 @@ export default function NewListingPage() {