session management update

merge-requests/994/merge
Elham Rababh 4 years ago
parent c30d6bebd8
commit 8069e89a61

@ -40,17 +40,13 @@ class BaseAppClient {
try {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
// String doctorID = await sharedPref.getString(DOCTOR_ID);
// if(doctorID != null)
// body['DoctorID'] = int.parse(doctorID);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) {
body['DoctorID'] = doctorProfile?.doctorID;
}
if (body['DoctorID'] == "")
body['DoctorID'] = null;
if (body['DoctorID'] == "") body['DoctorID'] = null;
if (body['EditedBy'] == null)
body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) {
@ -59,10 +55,13 @@ class BaseAppClient {
if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID;
} else {
String doctorID = await sharedPref.getString(DOCTOR_ID);
if (body['DoctorID'] == '') {
body['DoctorID'] = null;
} else if (doctorID != null) body['DoctorID'] = int.parse(doctorID);
}
if (body['DoctorID'] == '') {
body['DoctorID'] = null;
}
if (body['EditedBy'] == '') {
body.remove("EditedBy");
}

@ -59,8 +59,7 @@ class DashboardViewModel extends BaseViewModel {
_firebaseMessaging.getToken().then((String token) async {
if (token != '') {
// DEVICE_TOKEN = token;
///TODO Elham* return back
// authProvider.insertDeviceImei(token);
authProvider.insertDeviceImei(token);
}
});
}

Loading…
Cancel
Save