17 lines
585 B
Dart
17 lines
585 B
Dart
import '../../marianumconnect_query.dart';
|
|
import 'get_capabilities_response.dart';
|
|
|
|
/// Fetches the current user's mobile capability flags from
|
|
/// `GET /api/mobile/v1/me/capabilities`. Goes through the shared dio singleton
|
|
/// so the bearer token is attached automatically.
|
|
class GetCapabilities extends MarianumConnectQuery {
|
|
GetCapabilities({super.dio});
|
|
|
|
Future<CapabilitiesResponse> run() => guard(() async {
|
|
final response = await dio.get<Map<String, dynamic>>(
|
|
endpoint('me/capabilities'),
|
|
);
|
|
return CapabilitiesResponse.fromJson(response.data!);
|
|
});
|
|
}
|