family file switch back issue fixed

dev_aamir
aamir-csol 1 day ago
parent f1555c76a3
commit 38471a773c

@ -200,8 +200,6 @@ class AuthenticationRepoImp implements AuthenticationRepo {
}
}
@override
Future<Either<Failure, GenericApiModel<dynamic>>> checkActivationCodeRepo(
{required dynamic newRequest, // could be CheckActivationCodeReq or CheckActivationCodeRegisterReq
@ -276,11 +274,10 @@ class AuthenticationRepoImp implements AuthenticationRepo {
newRequest.forRegisteration = newRequest.isRegister ?? false;
newRequest.isRegister = false;
//silent login case removed token and login token
if(newRequest.logInTokenID.isEmpty && newRequest.isSilentLogin == true && (newRequest.loginType==1 || newRequest.loginType==4)) {
if (newRequest.logInTokenID.isEmpty && newRequest.isSilentLogin == true && (newRequest.loginType == 1 || newRequest.loginType == 4)) {
newRequest.logInTokenID = null;
newRequest.deviceToken = null;
}
}
Map<String, dynamic> familyRequest = {};
@ -315,13 +312,9 @@ class AuthenticationRepoImp implements AuthenticationRepo {
}
if (appState.getSuperUserID == responseID) {
// switchRequest['LoginType'] = 0;
switchRequest['LoginType'] = loginType;
switchRequest['PatientIdentificationID'] = "";
// switchRequest["PatientID"] = responseID;
// switchRequest["SuperUser"] = responseID;
// switchRequest["PatientID"] = appState.getAuthenticatedUser()?.patientId ?? 0;
// switchRequest["PatientMobileNumber"] = newRequest.patientMobileNumber?.toString().startsWith('0') == true ? newRequest.patientMobileNumber.toString() : '0${newRequest.patientMobileNumber}';
switchRequest['DeviceToken'] = newRequest.deviceToken;
switchRequest.removeWhere((key, value) => ['NationalID', 'isDentalAllowedBackend', 'ProjectOutSA', 'ForRegisteration'].contains(key));
}
}

@ -552,16 +552,16 @@ class AuthenticationViewModel extends ChangeNotifier {
});
} else {
final resultEither = await _authenticationRepo.checkActivationCodeRepo(
newRequest: CheckActivationCodeRegisterReq.fromJson(request),
activationCode: activationCode,
isRegister: false,
isFormFamilyFile: isFormFamilyFile,
patientShareRequestID: patientShareRequestID,
responseID: responseID,
isSwitchUser: isSwitchUser,
patientID: patientID,
loginType: _appState.getSuperUserID != null ? 0 : 2,
);
newRequest: CheckActivationCodeRegisterReq.fromJson(request),
activationCode: activationCode,
isRegister: false,
isFormFamilyFile: isFormFamilyFile,
patientShareRequestID: patientShareRequestID,
responseID: responseID,
isSwitchUser: isSwitchUser,
patientID: patientID,
// loginType: _appState.getSuperUserID != null ? 0 : 2,
loginType: loginTypeEnum.toInt);
resultEither.fold(
(failure) async => await _errorHandlerService.handleError(

Loading…
Cancel
Save