updateLearningPath method

Future<void> updateLearningPath(
  1. String pathId, {
  2. String? name,
  3. String? description,
  4. bool? isOnboarding,
})

Implementation

Future<void> updateLearningPath(
  String pathId, {
  String? name,
  String? description,
  bool? isOnboarding,
}) async {
  await _client
      .from('learning_paths')
      .update({
        // ignore: use_null_aware_elements
        if (name != null) 'name': name,
        // ignore: use_null_aware_elements
        if (description != null) 'description': description,
        // ignore: use_null_aware_elements
        if (isOnboarding != null) 'is_onboarding': isOnboarding,
        'updated_at': DateTime.now().toUtc().toIso8601String(),
      })
      .eq('id', pathId);
}