getSlotMappings method

  1. @override
Future<List<CourseToSlot>> getSlotMappings({
  1. required String token,
  2. required int slotId,
})
override

Fetches all mappings for the slot with slotId.

Implementation

@override
Future<List<CourseToSlot>> getSlotMappings({required String token, required int slotId}) async {
  log('Fetching slot mappings for slot $slotId');

  final response = await api.callFunction(
    function: 'local_lbplanner_slots_get_slot_filters',
    body: {
      'slotid': slotId,
    },
    token: token,
  );

  response.assertJson();

  return response.asList.map(CourseToSlot.fromJson).toList();
}