forked from yaso_meth/mih-project
update patientview call to take in signed in user & remove prints
This commit is contained in:
@@ -24,19 +24,19 @@ class _AddOrViewPatientState extends State<AddOrViewPatient> {
|
||||
//print("Patien manager page: $endpoint");
|
||||
final response = await http.get(Uri.parse(
|
||||
"${AppEnviroment.baseApiUrl}/patients/${widget.signedInUser.app_id}"));
|
||||
print("Here");
|
||||
print("Body: ${response.body}");
|
||||
print("Code: ${response.statusCode}");
|
||||
// print("Here");
|
||||
// print("Body: ${response.body}");
|
||||
// print("Code: ${response.statusCode}");
|
||||
// var errorCode = response.statusCode.toString();
|
||||
// var errorBody = response.body;
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
print("Here1");
|
||||
// print("Here1");
|
||||
var decodedData = jsonDecode(response.body);
|
||||
print("Here2");
|
||||
// print("Here2");
|
||||
Patient patients = Patient.fromJson(decodedData as Map<String, dynamic>);
|
||||
print("Here3");
|
||||
print(patients);
|
||||
// print("Here3");
|
||||
// print(patients);
|
||||
return patients;
|
||||
}
|
||||
return null;
|
||||
@@ -55,7 +55,7 @@ class _AddOrViewPatientState extends State<AddOrViewPatient> {
|
||||
if (snapshot.hasData) {
|
||||
// Extracting data from snapshot object
|
||||
//final data = snapshot.data as String;
|
||||
return PatientView(selectedPatient: snapshot.data!);
|
||||
return PatientView(signedInUser: widget.signedInUser);
|
||||
}
|
||||
}
|
||||
return AddPatient(signedInUser: widget.signedInUser);
|
||||
|
||||
Reference in New Issue
Block a user