From 17832fef469772938f4ee7be0d06cf781753219b Mon Sep 17 00:00:00 2001 From: Tero Halla-aho Date: Thu, 27 Nov 2025 23:43:22 +0200 Subject: [PATCH] Polish Swedish locale support --- app/api/listings/route.ts | 3 ++- app/listings/new/page.tsx | 8 +++++++- lib/i18n.ts | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) 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() {