({ launchIds })
| 32 | } |
| 33 | |
| 34 | async bookTrips({ launchIds }) { |
| 35 | const userId = this.context.user.id; |
| 36 | if (!userId) return; |
| 37 | |
| 38 | let results = []; |
| 39 | |
| 40 | // for each launch id, try to book the trip and add it to the results array |
| 41 | // if successful |
| 42 | for (const launchId of launchIds) { |
| 43 | const res = await this.bookTrip({ launchId }); |
| 44 | if (res) results.push(res); |
| 45 | } |
| 46 | |
| 47 | return results; |
| 48 | } |
| 49 | |
| 50 | async bookTrip({ launchId }) { |
| 51 | const userId = this.context.user.id; |
no test coverage detected