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

Function checkIfUserHasLiveTasks

utils/userStatus.js:424–434  ·  view source on GitHub ↗
(userId, tasksModel)

Source from the content-addressed store, hash-verified

422 */
423
424const checkIfUserHasLiveTasks = async (userId, tasksModel) => {
425 const liveTasksState = ["ASSIGNED", "IN_PROGRESS"];
426 let liveTasksSnapshot;
427 try {
428 liveTasksSnapshot = await tasksModel.where("assignee", "==", userId).where("status", "in", liveTasksState).get();
429 } catch (err) {
430 logger.error(`An error occurred while querying ${liveTasksState.join(",")} tasks:`, err);
431 throw err;
432 }
433 return liveTasksSnapshot.size > 0;
434};
435
436/**
437 * Generates the error response message

Callers 5

userStatus.test.jsFile · 0.85
cancelOooStatusFunction · 0.85
shouldAddIdleUserFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected