diff --git a/server/src/controllers/boat.controllers.ts b/server/src/controllers/boat.controllers.ts index e5b85041336993b44ef1cee1e937a3bcbc4371e0..17a578a14663aa8bb99f12d2f57c21d12d863b52 100644 --- a/server/src/controllers/boat.controllers.ts +++ b/server/src/controllers/boat.controllers.ts @@ -250,7 +250,7 @@ const updateBoatById = async (req: Request, res: Response) => { if (!(checkBoatName === null)) { return res - .status(404) + .status(409) .json({ success: false, error: "boatNameAlreadyExists" }); } } @@ -337,7 +337,7 @@ const updateBoatById = async (req: Request, res: Response) => { if (check === false) { return res .status(404) - .json({ success: false, error: listIfNotFound + " sportIdNotFound" }); + .json({ success: false, sports: listIfNotFound }); } //if sports Array is with valid id's, assign them to boat; create entry (boatid, each id of given sportIds) inf BoatHasSport table for (let i = 0; i < listIfFound.length; i++) { diff --git a/server/src/controllers/boatType.controllers.ts b/server/src/controllers/boatType.controllers.ts index 953ef22513a176281f959d9e302f6b64124ebd36..ab34aaba6ff2826d21f38cd87080821c70136410 100644 --- a/server/src/controllers/boatType.controllers.ts +++ b/server/src/controllers/boatType.controllers.ts @@ -20,7 +20,7 @@ const createBoatTypeController = async (req: Request, res: Response) => { if (findIfBoatTypeExists) { return res - .status(404) + .status(409) .json({ success: false, error: "boatTypeAlreadyExists" }); } @@ -153,7 +153,7 @@ const updateBoatTypeById = async (req: Request, res: Response) => { }); if (!(checkIfNameExists === null)) { return res - .status(404) + .status(409) .json({ success: false, error: "boatTypeAlreadyExists" }); } }