Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- method: 'PUT',
- path: '/v1/Admin/UserblockUnblock',
- config: {
- description: 'API for user account block or unblock.. 1-block 2-unblock',
- notes: 'API for user account block or unblock.. 1-block 2-unblock',
- tags: ['api'],
- pre: [
- { method: Utils.universalFunctions.verifyLoginToken, assign: "userDetails" }
- ],
- validate: {
- payload: {
- userid: Utils.Joi.string().length(24).trim().required().error(new Error('User Id is invalid.')),
- type: Utils.Joi.number().required().valid(1, 2), //1-block,2-Unblock
- messae:Utils.Joi.string().lowercase().required().label('message'),
- },
- headers: Utils.Joi.object({
- 'x-logintoken': Utils.Joi.string().required().trim()
- }).options({allowUnknown: true})
- }
- },
- handler: function (request, reply) {
- request.payload.userDetails = request.pre.userDetails[0]
- adminService.blockunblockuser(request.payload,function (err, res) {
- if (err) {
- reply(err)
- } else {
- reply(res)
- }
- });
- }
- },
Add Comment
Please, Sign In to add comment