(req, res)
| 52 | }; |
| 53 | |
| 54 | const getPlayerUsage = async (req, res) => { |
| 55 | try { |
| 56 | if (!req.query.year) { |
| 57 | res.status(400).send({ |
| 58 | error: 'year must be specified' |
| 59 | }); |
| 60 | } else if (!parseInt(req.query.year)) { |
| 61 | res.status(400).send({ |
| 62 | error: 'year must be numeric' |
| 63 | }); |
| 64 | } else if (req.query.playerId && !parseInt(req.query.playerId)) { |
| 65 | res.status(400).send({ |
| 66 | error: 'playerId must be numeric' |
| 67 | }); |
| 68 | } else { |
| 69 | const results = await service.getPlayerUsage(req.query.year, req.query.conference, req.query.position, req.query.team, req.query.playerId, req.query.excludeGarbageTime); |
| 70 | res.send(results); |
| 71 | } |
| 72 | } catch (err) { |
| 73 | Sentry.captureException(err); |
| 74 | res.status(500).send({ |
| 75 | error: 'Something went wrong.' |
| 76 | }); |
| 77 | } |
| 78 | }; |
| 79 | |
| 80 | const getReturningProduction = async (req, res) => { |
| 81 | try { |
nothing calls this directly
no outgoing calls
no test coverage detected