Do not select opponents during speedy reservation
This commit is contained in:
parent
bfc72f2cfb
commit
1a6fa08f6d
1 changed files with 9 additions and 5 deletions
|
|
@ -528,12 +528,16 @@ export class BaanReserverenService {
|
|||
})
|
||||
}
|
||||
|
||||
private async selectOpponents(opponents: Opponent[]) {
|
||||
private async selectOpponents(opponents: Opponent[], speedy = false) {
|
||||
try {
|
||||
if (speedy) {
|
||||
await this.selectOpponent('-1', 'Gast', 0)
|
||||
} else {
|
||||
for (let idx = 0; idx < opponents.length; idx += 1) {
|
||||
const { id, name } = opponents[idx]
|
||||
await this.selectOpponent(id, name, idx)
|
||||
}
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof RunnerOwnerSearchSelectionError) {
|
||||
this.loggerService.warn(
|
||||
|
|
@ -712,7 +716,7 @@ export class BaanReserverenService {
|
|||
reservation.dateRangeStart,
|
||||
)
|
||||
await this.selectOwner(reservation.ownerId)
|
||||
await this.selectOpponents(reservation.opponents)
|
||||
await this.selectOpponents(reservation.opponents, true)
|
||||
let errorReserving = false
|
||||
await this.confirmReservation().catch((error: Error) => {
|
||||
if (error instanceof RunnerReservationConfirmSubmitError) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue