Skip to content

Commit

Permalink
update endpoint up now
Browse files Browse the repository at this point in the history
  • Loading branch information
sridhar-5 committed Nov 9, 2021
1 parent 8941491 commit dcb972c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions routes/AdminUsersEndpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,19 @@ router.post(
}
);

router.put(
":/id",
[AuthenticateUser, CheckAdminUser],
async (request, response) => {
const UpdateEvent = await Events.findByIdAndUpdate(
request.params.id,
request.body
);
if (!UpdateEvent)
return response.status(400).send("Sorry..! .Event Not found...!");

response.status(200).send(UpdateEvent);
}
);

module.exports = router;

0 comments on commit dcb972c

Please sign in to comment.