generated from UoaWDCC/react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat & fix: added get all users & fixed other endpoints
- Loading branch information
1 parent
5889a50
commit 8aa649a
Showing
3 changed files
with
50 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import { Router } from "express"; | ||
import { createUser, getUser, updateUser, deleteUser } from "../controllers/UserController"; | ||
import { createUser, getUser, updateUser, deleteUser, getAllUsers } from "../controllers/UserController"; | ||
|
||
const userRoutes = Router(); | ||
|
||
userRoutes.post("/", createUser); | ||
|
||
userRoutes.get("/", getUser); | ||
userRoutes.get("/:id", getUser); | ||
|
||
userRoutes.put("/", updateUser); | ||
userRoutes.get("/", getAllUsers); | ||
|
||
userRoutes.delete("/", deleteUser); | ||
userRoutes.put("/:id", updateUser); | ||
|
||
userRoutes.delete("/:id", deleteUser); | ||
|
||
export default userRoutes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters