PAP-559: fix hospital_service

fix_bugs_Mar
Elham Rababah 5 years ago
parent 86dda2b6d6
commit 5dd2e9986e

@ -22,12 +22,13 @@ class HospitalService extends BaseService {
});
}
Future getHospitals() async {
Future getHospitals({bool isResBasedOnLoc = true}) async {
if(isResBasedOnLoc)
await _getCurrentLocation();
Map<String, dynamic> body = Map();
body['Latitude'] = _latitude;
body['Longitude'] = _longitude;
body['IsOnlineCheckIn'] = true;
body['Latitude'] = isResBasedOnLoc?_latitude:0;
body['Longitude'] = isResBasedOnLoc?_longitude:0;
body['IsOnlineCheckIn'] = isResBasedOnLoc;
body['PatientOutSA'] = 0;
await baseAppClient.post(GET_PROJECT,

@ -55,7 +55,7 @@ class AmRequestViewModel extends BaseViewModel {
Future getHospitals() async {
setState(ViewState.Busy);
await _hospitalService.getHospitals();
await _hospitalService.getHospitals(isResBasedOnLoc: false);
if (_hospitalService.hasError) {
error = _hospitalService.error;
setState(ViewState.Error);

Loading…
Cancel
Save