diff --git a/src/lib/theme-custom-store.ts b/src/lib/theme-custom-store.ts index 8414bba4..a7490608 100644 --- a/src/lib/theme-custom-store.ts +++ b/src/lib/theme-custom-store.ts @@ -1,4 +1,4 @@ -import { prisma } from "@/lib/prisma"; +import { db, WebsiteSetting } from "@/lib/db"; import { siteSettings } from "@/lib/services/site-settings"; import { PRESETS, @@ -86,11 +86,10 @@ export async function snapshotCurrentTheme(): Promise> { async function persist(themes: CustomTheme[]): Promise { const value = JSON.stringify(themes); - await prisma.websiteSetting.upsert({ - where: { key: STORE_KEY }, - create: { key: STORE_KEY, value, comment: "Theme (housekeeping)" }, - update: { value }, - }); + await db + .insert(WebsiteSetting) + .values({ key: STORE_KEY, value, comment: "Theme (housekeeping)" }) + .onDuplicateKeyUpdate({ set: { value } }); siteSettings.reload(); }