kyc and update risk profile api integration and issues fixed
This commit is contained in:
21
lib/view_model/KycApi/kyc_api.dart
Normal file
21
lib/view_model/KycApi/kyc_api.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'package:traderscircuit/Utils/api_urls.dart';
|
||||
import 'package:traderscircuit/Utils/base_manager.dart';
|
||||
import 'package:traderscircuit/data/network/network_api_services.dart';
|
||||
|
||||
class KycApi {
|
||||
Future<ResponseData<dynamic>> getKycUserApi() async {
|
||||
final response =
|
||||
await NetworkApiServices().getApi(ApiUrls.getKyc, isAuth: true);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
return response;
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ class RiskProfileApi {
|
||||
Future<ResponseData<dynamic>> getRiskProfileData() async {
|
||||
final response = await NetworkApiServices()
|
||||
.getApi(ApiUrls.getRiskProfileQuestionAnswerApi, isAuth: true);
|
||||
log(response.data.toString());
|
||||
// log(response.data.toString());
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
@@ -42,4 +42,22 @@ class RiskProfileApi {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getUserRiskProfileData() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.getRiskProfile,
|
||||
);
|
||||
// log(response.data.toString());
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
return response;
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user