mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
chore(server): return parent id of sessions (#10638)
This commit is contained in:
@@ -280,6 +280,9 @@ class CopilotSessionType {
|
||||
@Field(() => ID)
|
||||
id!: string;
|
||||
|
||||
@Field(() => ID, { nullable: true })
|
||||
parentSessionId!: string | undefined;
|
||||
|
||||
@Field(() => String)
|
||||
promptName!: string;
|
||||
}
|
||||
|
||||
@@ -401,7 +401,13 @@ export class ChatSessionService {
|
||||
workspaceId: string,
|
||||
docId?: string,
|
||||
options?: { action?: boolean }
|
||||
): Promise<Array<{ id: string; promptName: string }>> {
|
||||
): Promise<
|
||||
Array<{
|
||||
id: string;
|
||||
parentSessionId?: string;
|
||||
promptName: string;
|
||||
}>
|
||||
> {
|
||||
return await this.db.aiSession
|
||||
.findMany({
|
||||
where: {
|
||||
@@ -415,12 +421,14 @@ export class ChatSessionService {
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
parentSessionId: true,
|
||||
promptName: true,
|
||||
},
|
||||
})
|
||||
.then(sessions =>
|
||||
sessions.map(({ id, promptName }) => ({
|
||||
sessions.map(({ id, parentSessionId, promptName }) => ({
|
||||
id,
|
||||
parentSessionId: parentSessionId || undefined,
|
||||
promptName,
|
||||
}))
|
||||
);
|
||||
|
||||
@@ -197,6 +197,7 @@ type CopilotQuota {
|
||||
|
||||
type CopilotSessionType {
|
||||
id: ID!
|
||||
parentSessionId: ID
|
||||
promptName: String!
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user