feat: handle discover in server

This commit is contained in:
wancat committed 2023-08-29 13:28:18 +08:00
1 parent 264d70fe3f
commit ee7cd083bd
2 files changed
+41 -24

No files matched your search

+15
View File
@@ -1,4 +1,15 @@
import { model, Schema } from 'mongoose'
import { FileNode } from '@linux-odyssey/file-graph'
const nodeSchema = new Schema({
path: String,
type: String,
discovered: Boolean,
})
nodeSchema.add({
children: [nodeSchema],
})
const Session = model(
'Session',
@@ -28,6 +39,10 @@ const Session = model(
progress: String,
completion: [String],
hints: [String],
graph: {
type: nodeSchema,
default: new FileNode({ path: '/', name: '/', type: 'folder' }),
},
},
{ timestamps: true }
)