MCPcopy Create free account
hub / github.com/RealDevSquad/website-backend / fetchTaskRequestById

Function fetchTaskRequestById

controllers/tasksRequests.js:27–45  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

25};
26
27const fetchTaskRequestById = async (req, res) => {
28 try {
29 const id = req.params.id;
30 const data = await taskRequestsModel.fetchTaskRequestById(id);
31
32 if (!data.taskRequestExists) {
33 return res.status(404).json({
34 message: "Task request not found",
35 });
36 }
37 return res.status(200).json({
38 message: "Task request returned successfully",
39 data: data.taskRequestData,
40 });
41 } catch (err) {
42 logger.error("Error while fetching task requests", err);
43 return res.boom.badImplementation(INTERNAL_SERVER_ERROR);
44 }
45};
46
47const addTaskRequests = async (req, res) => {
48 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected