15 lines
593 B
Dart
15 lines
593 B
Dart
import '../../marianumconnect_query.dart';
|
|
import 'get_breakers_response.dart';
|
|
|
|
/// Fetches the app maintenance breaker rules from `GET /api/mobile/v1/breaker`.
|
|
/// The endpoint is public: the bearer token is attached if present but not
|
|
/// required, so this also works before login (e.g. to block the whole app).
|
|
class GetBreakers extends MarianumConnectQuery {
|
|
GetBreakers({super.dio});
|
|
|
|
Future<GetBreakersResponse> run() => guard(() async {
|
|
final response = await dio.get<Map<String, dynamic>>(endpoint('breaker'));
|
|
return GetBreakersResponse.fromJson(response.data!);
|
|
});
|
|
}
|