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 { siteSettings } from "@/lib/services/site-settings";
|
||||||
import {
|
import {
|
||||||
PRESETS,
|
PRESETS,
|
||||||
@@ -86,11 +86,10 @@ export async function snapshotCurrentTheme(): Promise<Record<string, string>> {
|
|||||||
|
|
||||||
async function persist(themes: CustomTheme[]): Promise<void> {
|
async function persist(themes: CustomTheme[]): Promise<void> {
|
||||||
const value = JSON.stringify(themes);
|
const value = JSON.stringify(themes);
|
||||||
await prisma.websiteSetting.upsert({
|
await db
|
||||||
where: { key: STORE_KEY },
|
.insert(WebsiteSetting)
|
||||||
create: { key: STORE_KEY, value, comment: "Theme (housekeeping)" },
|
.values({ key: STORE_KEY, value, comment: "Theme (housekeeping)" })
|
||||||
update: { value },
|
.onDuplicateKeyUpdate({ set: { value } });
|
||||||
});
|
|
||||||
siteSettings.reload();
|
siteSettings.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user