Skip to content

Commit

Permalink
Filter TOSTI venues on is_ordervenue
Browse files Browse the repository at this point in the history
  • Loading branch information
DeD1rk committed Nov 29, 2022
1 parent 0f1dec8 commit cb794f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/tosti/blocs/home_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class TostiHomeCubit extends Cubit<TostiHomeState> {
Future<void> 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;
Expand Down
5 changes: 3 additions & 2 deletions lib/tosti/tosti_api_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<ListResponse<TostiVenue>> getVenues({
int? limit,
int? offset,
bool? canBeReserved,
bool? isOrderVenue,
String? search,
}) {
return sandbox(() async {
Expand All @@ -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,
},
);
Expand Down

0 comments on commit cb794f9

Please sign in to comment.