Skip to content

Commit

Permalink
feat(apis): add autoRequest option ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBrisorgueil committed Apr 17, 2020
1 parent 916597c commit 761bdc7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions modules/apis/models/apis.model.mongoose.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const ApiMongoose = new Schema({
banner: String,
description: String,
savedb: Boolean,
autoRequest: Boolean,
user: {
type: Schema.ObjectId,
ref: 'User',
Expand Down
3 changes: 2 additions & 1 deletion modules/apis/models/apis.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion modules/apis/services/apis.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 761bdc7

Please sign in to comment.