From 7ab149a1cbe1780e1fd3789fdf2289aeb240388c Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 15 Apr 2021 17:09:02 +0300 Subject: [PATCH] hot fix --- lib/client/base_app_client.dart | 7 +++++-- lib/core/service/PatientMuseService.dart | 2 +- lib/screens/medical-file/medical_file_page.dart | 11 +++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index d31d4513..45e4a671 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -35,7 +35,7 @@ class BaseAppClient { String endPoint, { Map body, Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, + Function(String error, int statusCode) onFailure,bool isAllowAny = false }) async { String url = BASE_URL + endPoint; try { @@ -105,10 +105,13 @@ class BaseAppClient { if (!parsed['IsAuthenticated']) { if (body['OTP_SendType'] != null) { onFailure(getError(parsed), statusCode); - } else { + } else if(!isAllowAny){ await helpers.logout(); helpers.showErrorToast('Your session expired Please login agian'); } + if(isAllowAny){ + onFailure(getError(parsed), statusCode); + } } else if (parsed['MessageStatus'] == 1) { if (!parsed['IsAuthenticated']) onFailure(getError(parsed), statusCode); diff --git a/lib/core/service/PatientMuseService.dart b/lib/core/service/PatientMuseService.dart index 9626647a..39c4192c 100644 --- a/lib/core/service/PatientMuseService.dart +++ b/lib/core/service/PatientMuseService.dart @@ -23,7 +23,7 @@ class PatientMuseService extends BaseService { hasError = true; super.error = error; }, - body: body, + body: body,isAllowAny: true ); } } diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index d0382be8..811bf32d 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -126,14 +126,21 @@ class _MedicalFilePageState extends State { .entityList[0] .timelines[index] .doctorImage, - episode: model + episode: + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations.isNotEmpty? + model .medicalFileList[0] .entityList[0] .timelines[index] .timeLineEvents[0] .consulations[0] .episodeID - .toString(), + .toString():"", vistDate: model .medicalFileList[0] .entityList[0]