Skip to content

Commit

Permalink
changed req.body to req.query in getAdmins api
Browse files Browse the repository at this point in the history
  • Loading branch information
SwayamRana808 committed May 15, 2024
1 parent 524cddc commit e17f57c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/app/routes/admin/@validationSchema/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const getAdminsSchema = Joi.object({
.optional()
.pattern(/^(superAdmin|admin|self)$/),
page: Joi.number().optional(),
email: Joi.string().email().optional(),
});

const passwordChangeSchema = Joi.object({
Expand Down
2 changes: 1 addition & 1 deletion backend/app/routes/admin/getAdmins.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = async (req, res, next) => {
};
} else if (adminType === 'self') {
match = {
email: req.body.email || '',
email: req.query.email || '',
};
}
const [err, response] = await to(Admin.aggregate(getAdminsAggregate(match, page)));
Expand Down

0 comments on commit e17f57c

Please sign in to comment.