Define routes, controllers of sessions

Work in progress, debugging
This commit is contained in:
wancat committed 2023-07-19 16:42:09 +08:00
1 parent 50443b96e0
commit 04edfdd0dc
13 files changed
+1835 -60

No files matched your search

+19 -15
View File
@@ -1,20 +1,24 @@
import { model, Schema } from 'mongoose'
export default model(
const Session = model(
'Session',
{
name: String,
containerId: String,
user: {
type: Schema.ObjectId,
ref: 'User',
new Schema(
{
name: String,
containerId: String,
user: {
type: Schema.ObjectId,
ref: 'User',
},
quest: {
type: Schema.ObjectId,
ref: 'Quest',
},
finishedAt: Date,
terminals: [String],
},
quest: {
type: Schema.ObjectId,
ref: 'Quest',
},
finishedAt: Date,
terminals: [String],
},
{ timestamps: true }
{ timestamps: true }
)
)
export default Session