mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
45 lines
1.3 KiB
Dart
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;
|
|
}
|
|
}
|