add shipment in processing, update package, processing and receiving
This commit is contained in:
@@ -67,11 +67,15 @@ Future<dynamic> requestAPI(String path, method,
|
||||
path,
|
||||
data: payload,
|
||||
);
|
||||
var data = Status.fromJson(response.data);
|
||||
if (data.status == 'Ok') {
|
||||
return response.data["data"];
|
||||
} else {
|
||||
throw Exception(data.message);
|
||||
if (response.statusCode == HttpStatus.ok) {
|
||||
var data = Status.fromJson(response.data);
|
||||
if (data.status == 'Ok') {
|
||||
return response.data["data"];
|
||||
} else {
|
||||
throw Exception(data.message);
|
||||
}
|
||||
}else{
|
||||
throw Exception( "${response.statusCode} - ${response.statusMessage}");
|
||||
}
|
||||
} catch (e) {
|
||||
logger.warning("path:$path, api:$e");
|
||||
|
||||
Reference in New Issue
Block a user