mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
models: add required: true to id fields where missing
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
} from '../libs/errors';
|
||||
|
||||
export let schema = new mongoose.Schema({
|
||||
_id: {type: String, default: couponCode.generate},
|
||||
_id: {type: String, default: couponCode.generate, required: true},
|
||||
event: {type: String, enum: ['wondercon', 'google_6mo']},
|
||||
user: {type: String, ref: 'User'},
|
||||
}, {
|
||||
|
||||
@@ -10,6 +10,7 @@ export let schema = new Schema({
|
||||
type: String,
|
||||
default: uuid,
|
||||
validate: [validator.isUUID, 'Invalid uuid.'],
|
||||
required: true,
|
||||
},
|
||||
name: {type: String, required: true},
|
||||
challenge: {type: String},
|
||||
|
||||
@@ -25,6 +25,7 @@ export let schema = new Schema({
|
||||
type: String,
|
||||
default: uuid,
|
||||
validate: [validator.isUUID, 'Invalid uuid.'],
|
||||
required: true,
|
||||
},
|
||||
type: {type: String, required: true, enum: NOTIFICATION_TYPES},
|
||||
data: {type: Schema.Types.Mixed, default: () => {
|
||||
|
||||
Reference in New Issue
Block a user