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

Function getPP

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

Source from the content-addressed store, hash-verified

4 const service = serviceConstructor(db);
5
6 const getPP = async (req, res) => {
7 try {
8 if (!req.query.down || !req.query.distance) {
9 res.status(400).send({
10 error: 'Down and distance must be specified.'
11 });
12 } else if (!parseInt(req.query.down)) {
13 res.status(400).send({
14 error: 'Down must be numeric.'
15 });
16 } else if (!parseInt(req.query.distance)) {
17 res.status(400).send({
18 error: 'Distance must be numeric'
19 });
20 } else {
21 let results = await service.getPP(req.query.down, req.query.distance);
22 res.send(results);
23 }
24 } catch (err) {
25 Sentry.captureException(err);
26 res.status(500).send({
27 error: 'Something went wrong.'
28 });
29 }
30 };
31
32 const getWP = async (req, res) => {
33 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected