Skip to content

Commit

Permalink
hosting from github
Browse files Browse the repository at this point in the history
  • Loading branch information
udofia2 committed Sep 26, 2020
1 parent 864c6d2 commit fe55e18
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
efault.js
default.js
11 changes: 10 additions & 1 deletion api/controller/officer.Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,20 @@ const officerActions = (
*/
const resetPassword = async (req, res) => {
try {
const { password } = req.body

if(!password) return res.json({
status: "password not changed",
msg: "Please provide a new password"
})
const officer = await Officers.findOneAndUpdate(
{ _id: req.params.officerID },
req.body.password
);
res.json(officer);
res.json({
msg: "your password change was successful",
officer
});
} catch (err) {
res.status(500).json(err);
}
Expand Down
8 changes: 0 additions & 8 deletions config/default.js

This file was deleted.

0 comments on commit fe55e18

Please sign in to comment.