Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
546 B
2
Indexable
Never

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);
};

Leave a Comment