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

Function buildQueryByTypeId

utils/monitor.js:15–22  ·  view source on GitHub ↗
(queryParams)

Source from the content-addressed store, hash-verified

13 * @returns {Firestore.Query} - A Firestore query to check if a document exists.
14 */
15const buildQueryByTypeId = (queryParams) => {
16 const { userId, taskId } = queryParams;
17 if (userId) {
18 return trackedProgressesCollection.where("type", "==", "user").where("userId", "==", userId);
19 } else {
20 return trackedProgressesCollection.where("type", "==", "task").where("taskId", "==", taskId);
21 }
22};
23
24/**
25 * Builds a Firestore query for fetching tracked progress documents of a specific type based on the provided query parameters.

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected