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

Function fetchTaskByIssueId

models/tasks.js:358–377  ·  view source on GitHub ↗
(issueId)

Source from the content-addressed store, hash-verified

356 * @return {Promise<taskData|Object>}
357 */
358const fetchTaskByIssueId = async (issueId) => {
359 try {
360 const task = await tasksModel.where("github.issue.id", "==", issueId).get();
361 const [taskDoc] = task.docs;
362 let updatedTaskData;
363 if (taskDoc) {
364 updatedTaskData = { id: taskDoc.id, ...taskDoc.data() };
365 }
366 const taskData = await fromFirestoreData(updatedTaskData);
367
368 if (taskData?.status) {
369 taskData.status = TASK_STATUS[taskData.status.toUpperCase()];
370 }
371
372 return taskData;
373 } catch (err) {
374 logger.error("Error retrieving task data from issue Id", err);
375 throw err;
376 }
377};
378
379/**
380 * Fetch assigned self task

Callers

nothing calls this directly

Calls 2

fromFirestoreDataFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected