Fix save progress bug
This commit is contained in:
@@ -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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user