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