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