(allChallenges)
| 49 | * @returns {Promise<participants|Array>} |
| 50 | */ |
| 51 | const getParticipantsofChallenges = async (allChallenges) => { |
| 52 | return allChallenges.map(async (challenge) => { |
| 53 | const participants = await challengeQuery.fetchParticipantsData(challenge.participants); |
| 54 | return { |
| 55 | ...challenge, |
| 56 | participants, |
| 57 | }; |
| 58 | }); |
| 59 | }; |
| 60 | |
| 61 | /** |
| 62 | * Suscribe user to a challenge |