14 lines
506 B
Dart
14 lines
506 B
Dart
import '../../marianumconnect_query.dart';
|
|
|
|
/// GETs the selectable classes for the absence form (`absence/classes`). The
|
|
/// body is a bare JSON string array, so [getList] (which maps objects) does not
|
|
/// fit — read the raw list and cast.
|
|
class AbsenceClasses extends MarianumConnectQuery {
|
|
AbsenceClasses({super.dio});
|
|
|
|
Future<List<String>> run() => guard(() async {
|
|
final response = await dio.get<List<dynamic>>(endpoint('absence/classes'));
|
|
return response.data!.cast<String>();
|
|
});
|
|
}
|