diff --git a/modules/apis/models/apis.model.mongoose.js b/modules/apis/models/apis.model.mongoose.js index ab91f94a..03cb52f4 100644 --- a/modules/apis/models/apis.model.mongoose.js +++ b/modules/apis/models/apis.model.mongoose.js @@ -27,6 +27,7 @@ const ApiMongoose = new Schema({ banner: String, description: String, savedb: Boolean, + autoRequest: Boolean, user: { type: Schema.ObjectId, ref: 'User', diff --git a/modules/apis/models/apis.schema.js b/modules/apis/models/apis.schema.js index dcaec35f..1fe539e8 100644 --- a/modules/apis/models/apis.schema.js +++ b/modules/apis/models/apis.schema.js @@ -25,7 +25,8 @@ const ApiSchema = Joi.object().keys({ description: Joi.string().allow('').default('').optional(), user: Joi.string().trim().default(''), history: Joi.array().items(historySchema).optional(), - savedb: Joi.boolean().default(false).optional(), + savedb: Joi.boolean().default(false).required(), + autoRequest: Joi.boolean().default(false).required(), }); module.exports = { diff --git a/modules/apis/services/apis.service.js b/modules/apis/services/apis.service.js index e591bd6b..cbf7b24c 100644 --- a/modules/apis/services/apis.service.js +++ b/modules/apis/services/apis.service.js @@ -62,8 +62,9 @@ exports.update = async (api, body) => { api.params = body.params; api.status = body.status; api.banner = body.banner; - api.savedb = body.savedb; api.description = body.description; + api.savedb = body.savedb; + api.autoRequest = body.autoRequest; if (body.typing && body.typing !== '') api.typing = body.typing; else api.typing = null; if (body.mapping && body.mapping !== '') api.mapping = body.mapping;