|
|
|
@ -112,6 +112,17 @@ class EtqanOvrProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
Utils.showLoading(context);
|
|
|
|
Utils.showLoading(context);
|
|
|
|
getEtqanEmployeeRequestsList?.clear();
|
|
|
|
getEtqanEmployeeRequestsList?.clear();
|
|
|
|
getEtqanEmployeeRequestsList = await EtqanApiClient().getEmployeeEtqanRequests();
|
|
|
|
getEtqanEmployeeRequestsList = await EtqanApiClient().getEmployeeEtqanRequests();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Sort by createdDate in descending order (newest first)
|
|
|
|
|
|
|
|
if (getEtqanEmployeeRequestsList != null && getEtqanEmployeeRequestsList!.isNotEmpty) {
|
|
|
|
|
|
|
|
getEtqanEmployeeRequestsList!.sort((a, b) {
|
|
|
|
|
|
|
|
if (a.createdDate == null && b.createdDate == null) return 0;
|
|
|
|
|
|
|
|
if (a.createdDate == null) return 1;
|
|
|
|
|
|
|
|
if (b.createdDate == null) return -1;
|
|
|
|
|
|
|
|
return b.createdDate!.compareTo(a.createdDate!);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
isLoading = false;
|
|
|
|
isLoading = false;
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
@ -191,6 +202,17 @@ class EtqanOvrProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
if (response != null) {
|
|
|
|
if (response != null) {
|
|
|
|
getEtqanEmployeeRequestsList = await EtqanApiClient().getEmployeeEtqanRequests();
|
|
|
|
getEtqanEmployeeRequestsList = await EtqanApiClient().getEmployeeEtqanRequests();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Sort by ticketNumber in descending order (newest first)
|
|
|
|
|
|
|
|
if (getEtqanEmployeeRequestsList != null && getEtqanEmployeeRequestsList!.isNotEmpty) {
|
|
|
|
|
|
|
|
getEtqanEmployeeRequestsList!.sort((a, b) {
|
|
|
|
|
|
|
|
if (a.ticketNumber == null && b.ticketNumber == null) return 0;
|
|
|
|
|
|
|
|
if (a.ticketNumber == null) return 1;
|
|
|
|
|
|
|
|
if (b.ticketNumber == null) return -1;
|
|
|
|
|
|
|
|
return b.ticketNumber!.compareTo(a.ticketNumber!);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
return response;
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|