15 lines
454 B
Nim
15 lines
454 B
Nim
|
import pkg/chronos
|
||
|
import pkg/questionable
|
||
|
import pkg/questionable/results
|
||
|
|
||
|
import pkg/codex/sales/reservations
|
||
|
|
||
|
proc allAvailabilities*(r: Reservations): Future[seq[Availability]] {.async.} =
|
||
|
var ret: seq[Availability] = @[]
|
||
|
without availabilities =? (await r.availabilities), err:
|
||
|
raiseAssert "failed to get availabilities, error: " & err.msg
|
||
|
for a in availabilities:
|
||
|
if availability =? (await a):
|
||
|
ret.add availability
|
||
|
return ret
|