Untitled
Anonymous
plain_text
03/10/2024 4:34 PM
728 B
15
Indexable
const getInProgressController = async (req: Request, res: Response) => {
const { inProgress } = req.query;
const inProgressBoolean = inProgress === 'true';
const matches = await matchesService.getInProgress(inProgressBoolean);
return res.status(200).json(matches);
};
const getAllMatchesController = async (req: Request, res: Response) => {
const { inProgress } = req.query;
if (inProgress) return getInProgressController(req, res);
const matches = await matchesService.getAllMatches();
return res.status(200).json(matches);
};
Editor is loading...
Leave a Comment