updateLevel method

Future<void> updateLevel(
  1. String levelId, {
  2. String? name,
  3. String? description,
})

Update a curriculum level's name and/or description.

Implementation

Future<void> updateLevel(
  String levelId, {
  String? name,
  String? description,
}) async {
  final updates = <String, dynamic>{};
  if (name != null) updates['name'] = name;
  if (description != null) updates['description'] = description;
  if (updates.isEmpty) return;
  await _client.from('curriculum_levels').update(updates).eq('id', levelId);
}