Fix save progress bug

This commit is contained in:
adilallo committed 2026-05-20 19:58:32 -06:00
1 parent 2f2b5d0dc2
commit 7ee6282c1a
14 files changed
+193 -88

No files matched your search

+14
View File
@@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from "next/server";
import type { Prisma } from "@prisma/client";
import { prisma } from "../../../../../lib/server/db";
import {
getSessionPepper,
@@ -68,6 +69,19 @@ export async function GET(request: NextRequest) {
update: {},
});
if (row.draftPayload != null) {
await prisma.ruleDraft.upsert({
where: { userId: user.id },
create: {
userId: user.id,
payload: row.draftPayload as Prisma.InputJsonValue,
},
update: {
payload: row.draftPayload as Prisma.InputJsonValue,
},
});
}
const { token: sessionToken, expiresAt } = await createSessionForUser(
user.id,
);