MCPcopy Create free account
hub / github.com/CFBD/cfb-api / getPPAByPlayerSeason

Function getPPAByPlayerSeason

app/ppa/ppa.controller.js:140–168  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected