Files
syncrow-web/lib/services/home_api.dart
2025-01-22 15:44:46 +03:00

45 lines
1.3 KiB
Dart

import 'package:syncrow_web/pages/auth/model/user_model.dart';
import 'package:syncrow_web/services/api/http_service.dart';
import 'package:syncrow_web/utils/constants/api_const.dart';
class HomeApi {
Future fetchUserInfo(userId) async {
final response = await HTTPService().get(
path: ApiEndpoints.getUser.replaceAll('{userUuid}', userId!),
showServerMessage: true,
expectedResponseModel: (json) {
return UserModel.fromJson(json);
});
return response;
}
Future fetchTerms() async {
final response = await HTTPService().get(
path: ApiEndpoints.terms,
showServerMessage: true,
expectedResponseModel: (json) {
return json['data'];
});
return response;
}
Future fetchPolicy() async {
final response = await HTTPService().get(
path: ApiEndpoints.policy,
showServerMessage: true,
expectedResponseModel: (json) {
return json['data'];
});
return response;
}
Future confirmUserAgreements(uuid) async {
final response = await HTTPService().patch(
path: ApiEndpoints.userAgreements.replaceAll('{userUuid}', uuid!),
expectedResponseModel: (json) {
return json['data'];
});
return response;
}
}