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

Function assertUserOrTaskExists

utils/progresses.js:87–94  ·  view source on GitHub ↗
(queryParams)

Source from the content-addressed store, hash-verified

85 * @returns {Promise<void>} A promise that resolves if either the user or the task exists and rejects with a `NotFound` error if neither exists.
86 */
87const assertUserOrTaskExists = async (queryParams) => {
88 const { userId, taskId } = queryParams;
89 if (userId) {
90 await assertUserExists(userId);
91 } else if (taskId) {
92 await assertTaskExists(taskId);
93 }
94};
95
96/**
97 * Builds a Firestore query for retrieving progress documents within a date range and optionally filtered by user ID or task ID.

Callers 6

getProgressDocumentFunction · 0.85
getRangeProgressDataFunction · 0.85
getProgressByDateFunction · 0.85

Calls 2

assertUserExistsFunction · 0.85
assertTaskExistsFunction · 0.85

Tested by

no test coverage detected