mirror of
https://github.com/wassname/talk.git
synced 2026-08-17 11:27:52 +08:00
Added enum check for the user model
This commit is contained in:
+4
-1
@@ -24,7 +24,10 @@ const UserSchema = new mongoose.Schema({
|
||||
required: true
|
||||
}
|
||||
}],
|
||||
roles: [String]
|
||||
roles: {
|
||||
type: [{ type: String, enum: ['admin', 'moderator'] }],
|
||||
|
||||
}
|
||||
}, {
|
||||
timestamps: {
|
||||
createdAt: 'created_at',
|
||||
|
||||
Reference in New Issue
Block a user