Fix patient file api call issue
This commit is contained in:
@@ -45,32 +45,28 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
||||
String fileUrl = "";
|
||||
|
||||
Future<String> getFileUrlApiCall(String filePath) async {
|
||||
if (AppEnviroment.getEnv() == "Dev") {
|
||||
return "$basefile/mih/$filePath";
|
||||
var url = "$baseAPI/minio/pull/file/${AppEnviroment.getEnv()}/$filePath";
|
||||
//print(url);
|
||||
var response = await http.get(Uri.parse(url));
|
||||
// print("here1");
|
||||
//print(response.statusCode);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
//print("here2");
|
||||
String body = response.body;
|
||||
//print(body);
|
||||
//print("here3");
|
||||
var decodedData = jsonDecode(body);
|
||||
//print("Dedoced: ${decodedData['minioURL']}");
|
||||
|
||||
return decodedData['minioURL'];
|
||||
//AppUser u = AppUser.fromJson(decodedData);
|
||||
// print(u.email);
|
||||
//return "AlometThere";
|
||||
} else {
|
||||
var url = "$baseAPI/minio/pull/file/$filePath/prod";
|
||||
//print(url);
|
||||
var response = await http.get(Uri.parse(url));
|
||||
// print("here1");
|
||||
//print(response.statusCode);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
//print("here2");
|
||||
String body = response.body;
|
||||
//print(body);
|
||||
//print("here3");
|
||||
var decodedData = jsonDecode(body);
|
||||
//print("Dedoced: ${decodedData['minioURL']}");
|
||||
|
||||
return decodedData['minioURL'];
|
||||
//AppUser u = AppUser.fromJson(decodedData);
|
||||
// print(u.email);
|
||||
//return "AlometThere";
|
||||
} else {
|
||||
throw Exception(
|
||||
"Error: GetUserData status code ${response.statusCode}");
|
||||
}
|
||||
throw Exception("Error: GetUserData status code ${response.statusCode}");
|
||||
}
|
||||
|
||||
//print(url);
|
||||
// var response = await http.get(Uri.parse(url));
|
||||
// // print("here1");
|
||||
|
||||
Reference in New Issue
Block a user