mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +08:00
feat: add UserProfile collection, create on login
* add progress
This commit is contained in:
1 parent
e981bff3bb
commit
45f12acbd9
5 files changed
+75
-22
No files matched your search
@@ -1,24 +1,5 @@
|
||||
import { model, Schema } from 'mongoose'
|
||||
|
||||
const progressSchema = new Schema({
|
||||
quest: {
|
||||
type: String,
|
||||
ref: 'Quest',
|
||||
},
|
||||
sessions: [
|
||||
{
|
||||
type: Schema.ObjectId,
|
||||
ref: 'Session',
|
||||
},
|
||||
],
|
||||
completionStatus: {
|
||||
type: String,
|
||||
enum: ['incomplete', 'completed'],
|
||||
},
|
||||
startedAt: Date,
|
||||
finishedAt: Date,
|
||||
})
|
||||
|
||||
const User = model(
|
||||
'User',
|
||||
new Schema(
|
||||
@@ -42,7 +23,6 @@ const User = model(
|
||||
id: String,
|
||||
displayName: String,
|
||||
},
|
||||
progress: [progressSchema],
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
|
||||
Reference in new issue
Block a user