Added api for custom timetable events
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../../mhslApi.dart';
|
||||
import 'getCustomTimetableEventParams.dart';
|
||||
import 'getCustomTimetableEventResponse.dart';
|
||||
|
||||
class GetCustomTimetableEvent extends MhslApi<GetCustomTimetableEventResponse> {
|
||||
GetCustomTimetableEventParams params;
|
||||
GetCustomTimetableEvent(this.params) : super("server/timetable/customEvents?user=${params.user}");
|
||||
|
||||
@override
|
||||
GetCustomTimetableEventResponse assemble(String raw) {
|
||||
return GetCustomTimetableEventResponse.fromJson({"events": jsonDecode(raw)});
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Response>? request(Uri uri) {
|
||||
return http.get(uri);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user