From ca72966a37fb0867f314665fe950e979f156e87d Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Sat, 1 Aug 2026 14:15:43 +0200 Subject: [PATCH] refactor(db): migrate app pages and APIs from Prisma facade to Drizzle (6) Co-authored-by: Cursor --- src/lib/theme-custom-store.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/theme-custom-store.ts b/src/lib/theme-custom-store.ts index 8414bba462..a74906083a 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(); }