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

Function getMeanPassingPPA

app/player/player.controller.js:28–52  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

26 };
27
28 const getMeanPassingPPA = async (req, res) => {
29 try {
30 if (!req.query.id || !parseInt(req.query.id)) {
31 res.status(400).send({
32 error: 'a numeric id param is required'
33 });
34 } else if (req.query.rollingPlays && !parseInt(req.query.rollingPlays)) {
35 res.status(400).send({
36 error: 'rollingPlays must be numeric'
37 });
38 } else if (req.query.year && !parseInt(req.query.year)) {
39 res.status(400).send({
40 error: 'year must be numeric'
41 });
42 } else {
43 let results = await service.getMeanPassingChartData(req.query.id, req.query.rollingPlays, req.query.year);
44 res.send(results);
45 }
46 } catch (err) {
47 Sentry.captureException(err);
48 res.status(500).send({
49 error: 'Something went wrong.'
50 });
51 }
52 };
53
54 const getPlayerUsage = async (req, res) => {
55 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected