refactor(db): migrate app pages and APIs from Prisma facade to Drizzle (6)
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
30b54e99e7
commit
ca72966a37
1 file changed
+5
-6
@@ -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<Record<string, string>> {
|
||||
|
||||
async function persist(themes: CustomTheme[]): Promise<void> {
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user