add shipment in processing, update package, processing and receiving

This commit is contained in:
tzw
2025-03-06 17:59:15 +06:30
parent 9e6b288970
commit e75eacd1f9
20 changed files with 746 additions and 603 deletions

View File

@@ -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");