-
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(order-history): implement user order history route
- add more tests for GET /users/<userId>/orders - implement GET /users/<userId>/orders route to make all tests pass - add seed menu script for database [Finishes #160869959]
- Loading branch information
Showing
6 changed files
with
93 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
INSERT INTO menu(food_name, food_image, price) | ||
VALUES( | ||
'Tasty Prawns', | ||
'https://i.imgur.com/mTHYwlc.jpg', | ||
1250 | ||
); | ||
|
||
INSERT INTO menu(food_name, food_image, price) | ||
VALUES( | ||
'Turkey Wings', | ||
'https://i.imgur.com/Bfn1CxC.jpg', | ||
950 | ||
); | ||
|
||
INSERT INTO menu(food_name, food_image, price) | ||
VALUES( | ||
'Chicken Wings', | ||
'https://i.imgur.com/z490cis.jpg', | ||
850 | ||
); |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Router } from 'express'; | ||
import AuthHandler from '../middleware/authHandler'; | ||
import OrderController from '../controllers/orderController'; | ||
|
||
const router = new Router(); | ||
|
||
router.get('/users/:id/orders', AuthHandler.authorize, OrderController.getAllUserOrders); | ||
|
||
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