mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 23:26:30 +08:00
fix(server): session unique index conflict (#12865)
This commit is contained in:
@@ -1880,5 +1880,14 @@ export async function refreshPrompts(db: PrismaClient) {
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await db.aiSession.updateMany({
|
||||
where: {
|
||||
promptName: prompt.name,
|
||||
},
|
||||
data: {
|
||||
promptAction: prompt.action ?? null,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,6 +257,7 @@ export class ChatSessionService {
|
||||
...state,
|
||||
sessionId,
|
||||
promptName: state.prompt.name,
|
||||
promptAction: state.prompt.action ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -615,7 +616,7 @@ export class ChatSessionService {
|
||||
|
||||
await tx.aiSession.updateMany({
|
||||
where: { id: { in: actionIds } },
|
||||
data: { deletedAt: new Date() },
|
||||
data: { pinned: false, deletedAt: new Date() },
|
||||
});
|
||||
|
||||
return [...sessionIds, ...actionIds];
|
||||
|
||||
Reference in New Issue
Block a user