mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: handle discover in server
This commit is contained in:
1 parent
264d70fe3f
commit
ee7cd083bd
2 files changed
+41
-24
No files matched your search
@@ -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 }
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user