From 52c65f0d2b9939e3f9b9789a48e89f1c734c3768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Gran=C3=A1t?= Date: Tue, 27 Aug 2024 15:21:47 +0200 Subject: [PATCH] fix: structured keys (#49) --- src/ui/client/client.ts | 2 +- src/ui/hooks/useAllTranslations.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/client/client.ts b/src/ui/client/client.ts index 004bbca..43fe23e 100644 --- a/src/ui/client/client.ts +++ b/src/ui/client/client.ts @@ -45,7 +45,7 @@ const flattenParams = ( function buildQuery(object: { [key: string]: any }): string { return Object.keys(object) - .filter((k) => !!object[k]) + .filter((k) => object[k] !== undefined && object[k] !== null) .map((k) => { if (Array.isArray(object[k])) { return object[k] diff --git a/src/ui/hooks/useAllTranslations.ts b/src/ui/hooks/useAllTranslations.ts index 977ada6..c5bf711 100644 --- a/src/ui/hooks/useAllTranslations.ts +++ b/src/ui/hooks/useAllTranslations.ts @@ -30,7 +30,7 @@ export const useAllTranslations = () => { data[ns] = ( (await translationsLoadable.mutateAsync({ path: { languages: [language] }, - query: { ns }, + query: { ns, structureDelimiter: "" }, })) as any )?.[language]; }