Skip to content

Commit 06e007f

Browse files
committed
eateryController type fix
1 parent 9c781b7 commit 06e007f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/eateries/eateryController.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ export const getAllEateries = async (req: Request, res: Response) => {
1111
};
1212

1313
export const getEateryById = async (req: Request, res: Response) => {
14-
const eateryId = parseInt(req.params.eateryId, 10);
14+
const raw = req.params.eateryId;
15+
const idStr = Array.isArray(raw) ? raw[0] : raw;
16+
17+
const eateryId = parseInt(idStr, 10);
1518
const eatery = await eateryService.getEateryById(eateryId);
1619
return res.json(eatery);
1720
};

0 commit comments

Comments
 (0)