This commit is contained in:
Venba 2024-07-16 08:20:53 +05:30
parent 653dd27018
commit ce018606ea
4 changed files with 17 additions and 14 deletions

View File

@ -1,3 +1,3 @@
API_URL=https://venbait.in/nhance/dev/employeeRest/
BASE_HREF=/nhance/app/dev/
ENV=development
API_URL=https://dev.venbait.in/nhance/uat/employeeRest/
BASE_HREF=/nhance/app/uat/
ENV=production

View File

@ -1,3 +1,3 @@
API_URL=https://venbait.in/nhance/uat/employeeRest/
API_URL=https://dev.venbait.in/nhance/uat/employeeRest/
BASE_HREF=/nhance/app/uat/
ENV=production

View File

@ -1,3 +1,3 @@
API_URL=https://venbait.in/nhance/test/employeeRest/
BASE_HREF=/nhance/app/test/
ENV=test
API_URL=https://dev.venbait.in/nhance/uat/employeeRest/
BASE_HREF=/nhance/app/uat/
ENV=production

View File

@ -85,13 +85,11 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
}
Future<void> getPolicyDetails() async {
setState(() {
_isLoading = true;
});
try {
setState(() {
if (argumentsData != null && argumentsData is Map<String, dynamic>) {
if (argumentsData['type'] == 'GPA') {
_isLoading = true;
clientPolicyId = argumentsData['client_policy_id'];
clientId = argumentsData['client_id'];
policyType = argumentsData['type'];
@ -100,6 +98,7 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
inceptionType = int.parse(int_inception_type);
getEmployeeAndDependence(clientId, clientPolicyId);
} else if (argumentsData['type'] == 'GMC') {
_isLoading = true;
clientPolicyId = argumentsData['client_policy_id'];
clientId = argumentsData['client_id'];
policyType = argumentsData['type'];
@ -108,6 +107,7 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
inceptionType = int.parse(int_inception_type);
getEmployeeAndDependence(clientId, clientPolicyId);
} else if (argumentsData['type'] == 'SI TopUp') {
_isLoading = true;
clientPolicyId = argumentsData['client_policy_id'];
clientId = argumentsData['client_id'];
policyType = argumentsData['type'];
@ -116,6 +116,7 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
inceptionType = int.parse(int_inception_type);
getEmployeeAndDependence(clientId, clientPolicyId);
} else if (argumentsData['type'] == 'Dependent AddOn') {
_isLoading = true;
clientPolicyId = argumentsData['client_policy_id'];
clientId = argumentsData['client_id'];
policyType = argumentsData['type'];
@ -127,6 +128,7 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
}
});
} catch (e) {
_isLoading = false;
print('Exception occurred: $e');
} finally {
setState(() {
@ -136,10 +138,9 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
}
Future<void> getEmployeeAndDependence(clintID, getPolicyNo) async {
isLoading = true;
setState(() {
_isLoading = true;
});
// setState(() {
// _isLoading = true;
// });
try {
final response = await apiService.getEmployeeAndDependenceToApi(
clintID!, getPolicyNo!, empRefId!);
@ -154,11 +155,13 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
print(filteredData);
});
} else {
isLoading = false;
// ToastHelper.showWarningToast(
// context, 'Request failed with status: ${response.statusCode}');
print('Request failed with status: ${response['code']}');
}
} catch (e) {
_isLoading = false;
print('Exception occurred: $e');
} finally {
setState(() {