mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-15 00:56:26 +08:00
refactor(core): get copilot sessions api (#10168)
Fix issue [BS-2575](https://linear.app/affine-design/issue/BS-2575). ### What Changed? - Refactor `getCopilotSessions` api. - Add `docId` parameter. - Add `action` parameter.
This commit is contained in:
@@ -391,17 +391,18 @@ export class ChatSessionService {
|
||||
.reduce((prev, cost) => prev + cost, 0);
|
||||
}
|
||||
|
||||
async listSessions(
|
||||
async listSessionIds(
|
||||
userId: string,
|
||||
workspaceId: string,
|
||||
options?: { docId?: string; action?: boolean }
|
||||
docId?: string,
|
||||
options?: { action?: boolean }
|
||||
): Promise<string[]> {
|
||||
return await this.db.aiSession
|
||||
.findMany({
|
||||
where: {
|
||||
userId,
|
||||
workspaceId,
|
||||
docId: workspaceId === options?.docId ? undefined : options?.docId,
|
||||
docId,
|
||||
prompt: {
|
||||
action: options?.action ? { not: null } : null,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user