Skip to content

Commit

Permalink
feat(server): validate housing update inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Falinor committed Jan 22, 2025
1 parent f10438b commit 01cb088
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion server/src/routers/protected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,15 @@ router.post(
validator.validate,
housingController.updateList
);
router.put('/housing/:id', housingController.updateNext);
router.put(
'/housing/:id',
hasRole([UserRoles.Usual, UserRoles.Admin]),
validatorNext.validate({
params: object({ id: schemas.id }),
body: schemas.housingUpdatePayload
}),
housingController.updateNext
);
router.post(
'/housing/:housingId',
[param('housingId').isUUID(), ...housingController.updateValidators],
Expand Down

0 comments on commit 01cb088

Please sign in to comment.