feat: send response to frontend

This commit is contained in:
wancat committed 2024-02-29 10:54:53 +08:00
1 parent fb69cb4e10
commit 88ee8f2cc3
8 files changed
+46 -35

No files matched your search

+8
View File
@@ -1,5 +1,7 @@
import { model, Schema, Types } from 'mongoose'
import { IResponse, responseSchema } from './response.js'
export interface INode {
path: string
type: string
@@ -53,6 +55,7 @@ export interface ISession {
lastActivityAt: Date
tasks: ITask[]
hints: string[][]
responses: IResponse[][]
graph: INode
}
@@ -85,6 +88,11 @@ export const Session = model<ISession>(
},
tasks: [taskSchema],
hints: [[String]],
responses: {
type: [[responseSchema]],
required: true,
default: [],
},
graph: {
type: nodeSchema,
default: {