({ type, userId, taskId })
| 36 | * @returns {Query} A Firestore query object that filters progress documents based on the given parameters. |
| 37 | */ |
| 38 | const buildQueryForPostingProgress = ({ type, userId, taskId }) => { |
| 39 | const query = |
| 40 | type === "user" |
| 41 | ? progressesCollection.where("type", "==", "user").where("userId", "==", userId) |
| 42 | : progressesCollection.where("type", "==", "task").where("taskId", "==", taskId); |
| 43 | return query; |
| 44 | }; |
| 45 | |
| 46 | /** |
| 47 | * Checks if a user with a given ID exists in the system. |
no outgoing calls
no test coverage detected