From ec1f4c9374e06e3defed3c728be603c10e4e7baa Mon Sep 17 00:00:00 2001 From: Dries Augustyns Date: Thu, 26 Feb 2026 20:57:14 +0100 Subject: [PATCH] fix: Support any locale on creation --- apps/api/src/services/ContactService.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/api/src/services/ContactService.ts b/apps/api/src/services/ContactService.ts index 9c032be..f5ea170 100644 --- a/apps/api/src/services/ContactService.ts +++ b/apps/api/src/services/ContactService.ts @@ -1,5 +1,4 @@ import {type Contact, Prisma} from '@plunk/db'; -import {isValidLanguageCode} from '@plunk/shared'; import type {CursorPaginatedResponse, FilterCondition, FilterGroup} from '@plunk/types'; import {toPrismaJson} from '@plunk/types'; @@ -236,12 +235,9 @@ export class ContactService { } // Validate locale field (special user-settable field) + // Only validate type - any locale string is accepted since we default to English if unsupported if (key === 'locale') { - if (typeof value === 'string') { - if (!isValidLanguageCode(value)) { - throw new HttpException(400, `Invalid locale code: ${value}. Must be one of: en, nl, fr, hi, de`); - } - } else if (value !== null && value !== undefined) { + if (value !== null && value !== undefined && typeof value !== 'string') { throw new HttpException(400, 'Locale must be a string'); } }