From cb794f9331e60bf613af942d6277267bff6eafb9 Mon Sep 17 00:00:00 2001 From: Dirk Doesburg Date: Tue, 29 Nov 2022 20:19:31 +0100 Subject: [PATCH] Filter TOSTI venues on is_ordervenue --- lib/tosti/blocs/home_cubit.dart | 6 +++--- lib/tosti/tosti_api_repository.dart | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/tosti/blocs/home_cubit.dart b/lib/tosti/blocs/home_cubit.dart index 5d17a7ba2..cd86b06a6 100644 --- a/lib/tosti/blocs/home_cubit.dart +++ b/lib/tosti/blocs/home_cubit.dart @@ -15,12 +15,12 @@ class TostiHomeCubit extends Cubit { Future load() async { emit(state.copyWith(isLoading: true)); try { - final venuesFuture = api.getVenues(limit: 999); - final playersFuture = api.getPlayers(limit: 999); + final venuesFuture = api.getVenues(limit: 99, isOrderVenue: true); + final playersFuture = api.getPlayers(limit: 99); final shiftsFuture = api.getShifts( startLTE: DateTime.now(), endGTE: DateTime.now(), - limit: 999, + limit: 99, ); final venuesResponse = await venuesFuture; diff --git a/lib/tosti/tosti_api_repository.dart b/lib/tosti/tosti_api_repository.dart index c96e9d372..b79c4aef8 100644 --- a/lib/tosti/tosti_api_repository.dart +++ b/lib/tosti/tosti_api_repository.dart @@ -284,12 +284,12 @@ class TostiApiRepository { /// Get a list of [TostiVenue]s. /// - /// Use `limit` and `offset` for pagination. You can also filter on - /// `canBeReserved` and search with `search`. + /// Use `limit` and `offset` for pagination. Future> getVenues({ int? limit, int? offset, bool? canBeReserved, + bool? isOrderVenue, String? search, }) { return sandbox(() async { @@ -300,6 +300,7 @@ class TostiApiRepository { if (offset != null) 'offset': offset.toString(), if (canBeReserved != null) 'can_be_reserved': canBeReserved.toString(), + if (isOrderVenue != null) 'is_ordervenue': isOrderVenue.toString(), if (search != null) 'search': search, }, );