Skip to content
Snippets Groups Projects
Commit 8f7c7643 authored by alrwasheda's avatar alrwasheda :speech_balloon:
Browse files

update Boat by Id route

parent c2d31b69
No related branches found
No related tags found
No related merge requests found
...@@ -31,4 +31,15 @@ boatsRouter.post( ...@@ -31,4 +31,15 @@ boatsRouter.post(
boatControllers.createBoat boatControllers.createBoat
); );
//update boat by id
boatsRouter.patch(
"/api/boat/:id/",
body("name").if(body("name").exists()).not().isEmpty(),
body("boattype").if(body("boattype").exists()).not().isEmpty(),
body("status").if(body("status").exists()).not().isEmpty().isIn([1, 0]),
body("tags").if(body("tags").exists()).not().isEmpty().isArray(),
handleValidationResult,
validateToken,
boatControllers.updateBoatById
)
export default boatsRouter; export default boatsRouter;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment