createSlot method

  1. @override
Future<Slot> createSlot({
  1. required String token,
  2. required Slot slot,
})
override

Pushes a new slot to the server.

Implementation

@override
Future<Slot> createSlot({required String token, required Slot slot}) async {
  log('Creating slot $slot');

  final json = slot.toJson()
    ..remove('id')
    ..remove('');

  final response = await api.callFunction(
    function: 'local_lbplanner_slots_create_slot',
    body: json,
    token: token,
  );

  response.assertJson();

  return Slot.fromJson(response.asJson);
}