From 570b0774bda2f5ae5e4434281436d3d9f2cc8c8f Mon Sep 17 00:00:00 2001 From: poyrazavsever Date: Mon, 20 Jul 2026 11:22:49 +0300 Subject: [PATCH] fix: fixed service lislocales --- app/(dashboard)/calendar/page.tsx | 6 +++++- app/(dashboard)/clients/page.tsx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/(dashboard)/calendar/page.tsx b/app/(dashboard)/calendar/page.tsx index 489f666..e24b55e 100644 --- a/app/(dashboard)/calendar/page.tsx +++ b/app/(dashboard)/calendar/page.tsx @@ -3,6 +3,8 @@ import { requireFreelancerBackend } from "@/server/web/freelancer"; import { resolveFreelancerLocale } from "@/server/i18n/resolver"; import { getClientI18nPayload } from "@/server/i18n/translator"; import { I18nProvider } from "@/components/i18n/i18n-provider"; +import { getSqliteConnection } from "@/server/db/client"; +import { I18nService } from "@/server/i18n/service"; import type { ContentTranslationRow } from "@/server/i18n/content"; function buildTranslations(rows: ContentTranslationRow[] | undefined) { @@ -19,7 +21,9 @@ export default async function CalendarPage() { const { context, actor, service } = await requireFreelancerBackend(); const resolvedLocale = await resolveFreelancerLocale(context); const payload = getClientI18nPayload(resolvedLocale.locale, ["calendar"]); - const activeLocales = service.listLocales(actor).filter(l => l.status !== "archived").map(l => ({ code: l.code, name: l.nativeName })); + + const i18n = new I18nService(getSqliteConnection().db); + const activeLocales = i18n.listLocales(actor).filter(l => l.status !== "archived").map(l => ({ code: l.code, name: l.nativeName })); const eventRows = service.listCalendarEvents(actor); const clientRows = service.listClients(actor); diff --git a/app/(dashboard)/clients/page.tsx b/app/(dashboard)/clients/page.tsx index acdc207..810e4e3 100644 --- a/app/(dashboard)/clients/page.tsx +++ b/app/(dashboard)/clients/page.tsx @@ -3,6 +3,8 @@ import { requireFreelancerBackend } from "@/server/web/freelancer"; import { resolveFreelancerLocale } from "@/server/i18n/resolver"; import { getClientI18nPayload } from "@/server/i18n/translator"; import { I18nProvider } from "@/components/i18n/i18n-provider"; +import { getSqliteConnection } from "@/server/db/client"; +import { I18nService } from "@/server/i18n/service"; import type { ContentTranslationRow } from "@/server/i18n/content"; function buildTranslations(rows: ContentTranslationRow[] | undefined) { @@ -19,7 +21,9 @@ export default async function ClientsPage() { const { context, actor, service } = await requireFreelancerBackend(); const resolvedLocale = await resolveFreelancerLocale(context); const payload = getClientI18nPayload(resolvedLocale.locale, ["clients"]); - const activeLocales = service.listLocales(actor).filter(l => l.status !== "archived").map(l => ({ code: l.code, name: l.nativeName })); + + const i18n = new I18nService(getSqliteConnection().db); + const activeLocales = i18n.listLocales(actor).filter(l => l.status !== "archived").map(l => ({ code: l.code, name: l.nativeName })); const clientsData = service.listClients(actor); const projects = service.listProjects(actor);