Upgrade mongoose (#10767)

* fix mongoose and upgrade

* fix more validations
This commit is contained in:
Matteo Pagliazzi
2018-10-23 13:25:14 +02:00
committed by GitHub
parent d49db6d367
commit c813afba44
13 changed files with 107 additions and 67 deletions

View File

@@ -5,7 +5,7 @@ import validator from 'validator';
export let schema = new mongoose.Schema({
planId: String,
subscriptionId: String,
owner: {type: String, ref: 'User', validate: [validator.isUUID, 'Invalid uuid.']},
owner: {type: String, ref: 'User', validate: [v => validator.isUUID(v), 'Invalid uuid.']},
quantity: {type: Number, default: 1},
paymentMethod: String, // enum: ['Paypal', 'Stripe', 'Gift', 'Amazon Payments', 'Google', '']}
customerId: String, // Billing Agreement Id in case of Amazon Payments