(req, res)
| 138 | }; |
| 139 | |
| 140 | const getPPAByPlayerSeason = async (req, res) => { |
| 141 | try { |
| 142 | if (req.query.year && !parseInt(req.query.year)) { |
| 143 | res.status(400).send({ |
| 144 | error: 'year must be numeric' |
| 145 | }); |
| 146 | } else if (req.query.week && !parseInt(req.query.week)) { |
| 147 | res.status(400).send({ |
| 148 | error: 'week must be numeric' |
| 149 | }); |
| 150 | } else if (req.query.threshold && !parseInt(req.query.threshold)) { |
| 151 | res.status(400).send({ |
| 152 | error: 'threshold must by numeric' |
| 153 | }); |
| 154 | } else if (req.query.playerId && !parseInt(req.query.playerId)) { |
| 155 | res.status(400).send({ |
| 156 | error: 'playerId must be numeric' |
| 157 | }); |
| 158 | } else { |
| 159 | const results = await service.getPPAByPlayerSeason(req.query.year, req.query.conference, req.query.position, req.query.team, req.query.playerId, req.query.threshold, req.query.excludeGarbageTime); |
| 160 | res.send(results); |
| 161 | } |
| 162 | } catch (err) { |
| 163 | Sentry.captureException(err); |
| 164 | res.status(500).send({ |
| 165 | error: 'Something went wrong.' |
| 166 | }); |
| 167 | } |
| 168 | }; |
| 169 | |
| 170 | const getPregameWP = async (req, res) => { |
| 171 | try { |
nothing calls this directly
no outgoing calls
no test coverage detected