simplify: dedupe boilerplate and remove dead code across all layers
This commit is contained in:
+4
-6
@@ -4,10 +4,8 @@ import '../../marianumconnect_query.dart';
|
||||
class TimetableCustomEventsGet extends MarianumConnectQuery {
|
||||
TimetableCustomEventsGet({super.dio});
|
||||
|
||||
Future<GetCustomTimetableEventResponse> run() => guard(() async {
|
||||
final response = await dio.get<Map<String, dynamic>>(
|
||||
endpoint('timetable/custom-events'),
|
||||
);
|
||||
return GetCustomTimetableEventResponse.fromJson(response.data!);
|
||||
});
|
||||
Future<GetCustomTimetableEventResponse> run() => getObject(
|
||||
'timetable/custom-events',
|
||||
GetCustomTimetableEventResponse.fromJson,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user