Add a controller and router to update a user's password

+ Add a function to update the password internally
+ The current interface could be improved (made more RESTful)
This commit is contained in:
Stephan
2021-12-31 00:11:04 +01:00
parent bfca7e8672
commit 5b02905d71
2 changed files with 96 additions and 1 deletions
+4 -1
View File
@@ -1,5 +1,5 @@
import express from "express";
import { getAllAdmins, createAdmin } from "../Controllers/admin.controller";
import { getAllAdmins, createAdmin, updatePassword } from "../Controllers/admin.controller";
import { requireAuthentication } from "../Middleware/auth/auth";
const router = express.Router();
@@ -8,4 +8,7 @@ router.get("/", requireAuthentication, getAllAdmins);
router.post("/", requireAuthentication, createAdmin);
// TODO: Use URL parameters to specify the user to update
router.put("/password", requireAuthentication, updatePassword);
export default router;