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

Function getSeasonStats

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

Source from the content-addressed store, hash-verified

100 };
101
102 const getSeasonStats = async (req, res) => {
103 try {
104 if (!req.query.year) {
105 res.status(400).send({
106 error: 'year must be specified'
107 });
108 } else if (!parseInt(req.query.year)) {
109 res.status(400).send({
110 error: 'year must be an integer'
111 });
112 } else if (req.query.startWeek && !parseInt(req.query.startWeek)) {
113 res.status(400).send({
114 error: 'startWeek must be an integer'
115 });
116 } else if (req.query.endWeek && !parseInt(req.query.endWeek)) {
117 res.status(400).send({
118 error: 'endWeek must be an integer'
119 });
120 } else {
121 const data = await service.getSeasonStats(req.query.year, req.query.conference, req.query.team, req.query.startWeek, req.query.endWeek, req.query.seasonType, req.query.category);
122
123 res.send(data);
124 }
125 } catch (err) {
126 Sentry.captureException(err);
127 res.status(500).send({
128 error: 'Something went wrong.'
129 });
130 }
131 };
132
133 const getTransferPortal = async (req, res) => {
134 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected