(queryParams)
| 13 | * @returns {Firestore.Query} - A Firestore query to check if a document exists. |
| 14 | */ |
| 15 | const 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. |
no outgoing calls
no test coverage detected