-
We're in the process of migrating from express to this library. Here's an example of what we're moving: router.get("/inventories", (req, res) => InventoryController.getInventories(...));
router.post("/inventories", (req, res) => InventoryController.createInventory(...));
router.get("/inventories/:id", (req, res) => InventoryController.getInventory(...));
router.put("/inventories/:id", (req, res) => InventoryController.updateInventory(...));
router.get("/inventories/filterOptions", (req, res) => InventoryController.getFilterOptions(...)); Our router using const router: Routing = {
api: {
inventories: {
'': new DependsOnMethod({
get: Endpoints.getInventoriesEndpoint,
post: Endpoints.createInventoryEndpoint,
}),
':id': new DependsOnMethod({
get: Endpoints.getInventoryEndpoint,
put: Endpoints.updateInventoryEndpoint,
}),
filterOptions: Endpoints.getInventoryFilterOptionsEndpoint,
}
},
}; The issue we're running into is the Not sure if we have to setup the routing in a different way to handle nested routes with path params, or if this is a bug. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hello @JUNIORCO , |
Beta Was this translation helpful? Give feedback.
-
@RobinTail Thank you that fixed it 🙌 Can I just ask why that works? |
Beta Was this translation helpful? Give feedback.
-
@JUNIORCO , for your future refactoring you may consider making
Kinda re-arrange it do a very own dedicated place. Thus, you'd not need to deal with collisions and order-depending Routing definitions. |
Beta Was this translation helpful? Give feedback.
Hello @JUNIORCO ,
Did you try to move
filterOptions
entry above the:id
one?