(error, res)
| 29 | }; |
| 30 | |
| 31 | const formatError = (error, res) => { |
| 32 | if (error.message === "401") { |
| 33 | return res.status(401).send({ error: "Not authorized" }); |
| 34 | } |
| 35 | if (error.message === "404") { |
| 36 | return res.status(404).send({ error: "Not Found" }); |
| 37 | } |
| 38 | return res.status(400).send(error); |
| 39 | }; |
| 40 | |
| 41 | /* |
| 42 | ** Route to get all the templates from a team |