Apply suggestion changes: return the reservation module error

This commit is contained in:
Arnaud 2025-02-24 09:58:35 +01:00
parent c437ccf9a7
commit b64aa5042b
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663

View File

@ -307,11 +307,8 @@ proc updateAvailability(
return failure(err)
if obj.until > 0:
without allReservations =? await self.all(Reservation, obj.id):
let error = newException(
GetFailedError,
"Until parameter must be greater or equal the current longest request",
)
without allReservations =? await self.all(Reservation, obj.id), error:
error.msg = "Error updating reservation: " & error.msg
return failure(error)
let requestEnds = allReservations.mapIt(it.validUntil)