Do not select opponents during speedy reservation

This commit is contained in:
Collin Duncan 2024-05-07 13:15:26 +02:00
parent bfc72f2cfb
commit 1a6fa08f6d
No known key found for this signature in database

View file

@ -528,11 +528,15 @@ export class BaanReserverenService {
}) })
} }
private async selectOpponents(opponents: Opponent[]) { private async selectOpponents(opponents: Opponent[], speedy = false) {
try { try {
for (let idx = 0; idx < opponents.length; idx += 1) { if (speedy) {
const { id, name } = opponents[idx] await this.selectOpponent('-1', 'Gast', 0)
await this.selectOpponent(id, name, idx) } else {
for (let idx = 0; idx < opponents.length; idx += 1) {
const { id, name } = opponents[idx]
await this.selectOpponent(id, name, idx)
}
} }
} catch (error: unknown) { } catch (error: unknown) {
if (error instanceof RunnerOwnerSearchSelectionError) { if (error instanceof RunnerOwnerSearchSelectionError) {
@ -712,7 +716,7 @@ export class BaanReserverenService {
reservation.dateRangeStart, reservation.dateRangeStart,
) )
await this.selectOwner(reservation.ownerId) await this.selectOwner(reservation.ownerId)
await this.selectOpponents(reservation.opponents) await this.selectOpponents(reservation.opponents, true)
let errorReserving = false let errorReserving = false
await this.confirmReservation().catch((error: Error) => { await this.confirmReservation().catch((error: Error) => {
if (error instanceof RunnerReservationConfirmSubmitError) { if (error instanceof RunnerReservationConfirmSubmitError) {