-
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(add-food): implement route to allow admin add new meals
- create a POST /api/v1/menu which can be used by just admins - write test for the endpoint [Finishes #160875996]
- Loading branch information
Showing
4 changed files
with
115 additions
and
0 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
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,9 +1,17 @@ | ||
import { Router } from 'express'; | ||
import AuthHandler from '../middleware/authHandler'; | ||
import MenuController from '../controllers/menuController'; | ||
import Sanitize from '../middleware/sanitizer'; | ||
|
||
const router = new Router(); | ||
|
||
router.get('/', AuthHandler.authorize, MenuController.getMenu); | ||
router.post( | ||
'/', | ||
AuthHandler.authorize, | ||
AuthHandler.authorizeAdmin, | ||
Sanitize.addFood, | ||
MenuController.addFood, | ||
); | ||
|
||
export default router; |
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