setDeadline method

  1. @override
Future<void> setDeadline(
  1. String token,
  2. PlanDeadline deadline
)
override

Sets the given deadline in the plan of the user associated with the given token.

If a deadline with the same ID already exists, it will be replaced.

Implementation

@override
Future<void> setDeadline(String token, PlanDeadline deadline) async {
  log('Setting deadline ${deadline.id}');

  try {
    await _apiService.callFunction(
      function: 'local_lbplanner_plan_set_deadline',
      token: token,
      body: deadline.toJson(),
    );

    log('Deadline ${deadline.id} set');
  } catch (e, s) {
    log('Failed to set deadline $deadline', e, s);
    rethrow;
  }
}