31 lines
931 B
Dart
31 lines
931 B
Dart
import 'package:tm_app/data/services/model/company_profile_response/company_profile_response.dart';
|
|
import 'package:tm_app/data/services/model/profile_response/profile_response.dart';
|
|
|
|
import '../../core/network/network_manager.dart';
|
|
import '../../core/utils/result.dart';
|
|
|
|
class ProfileService {
|
|
ProfileService({required NetworkManager networkManager})
|
|
: _networkManager = networkManager;
|
|
|
|
final NetworkManager _networkManager;
|
|
|
|
Future<Result<ProfileResponse>> getProfile() async {
|
|
final result = await _networkManager.makeRequest(
|
|
'/api/v1/profile',
|
|
method: 'GET',
|
|
(json) => ProfileResponse.fromJson(json),
|
|
);
|
|
return result;
|
|
}
|
|
|
|
Future<Result<CompanyProfileResponse>> getCompanyProfile() async {
|
|
final result = await _networkManager.makeRequest(
|
|
'/api/v1/companies',
|
|
method: 'GET',
|
|
(json) => CompanyProfileResponse.fromJson(json),
|
|
);
|
|
return result;
|
|
}
|
|
}
|