advanceEnrollment method

Future<void> advanceEnrollment(
  1. String enrollmentId,
  2. int newPosition, {
  3. DateTime? completedAt,
})

Implementation

Future<void> advanceEnrollment(
  String enrollmentId,
  int newPosition, {
  DateTime? completedAt,
}) async {
  await _client
      .from('learning_path_enrollments')
      .update({
        'current_step_position': newPosition,
        if (completedAt != null)
          'completed_at': completedAt.toUtc().toIso8601String(),
      })
      .eq('id', enrollmentId);
}