mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 13:36:50 +00:00
Fix references for showServerError
This commit is contained in:
parent
f91c40cccd
commit
96ba41474f
14
lib/api.dart
14
lib/api.dart
@ -227,8 +227,8 @@ class InvenTreeAPI {
|
||||
if (data == null || !data.containsKey("server") || !data.containsKey("version") || !data.containsKey("instance")) {
|
||||
|
||||
showServerError(
|
||||
"Missing Data",
|
||||
"Server response missing required fields"
|
||||
I18N.of(ctx).missingData,
|
||||
I18N.of(ctx).serverMissingData,
|
||||
);
|
||||
|
||||
return false;
|
||||
@ -283,7 +283,7 @@ class InvenTreeAPI {
|
||||
case 403:
|
||||
showServerError(
|
||||
I18N.of(ctx).serverAuthenticationError,
|
||||
"Incorrect username:password combination"
|
||||
I18N.of(ctx).invalidUsernamePassword,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@ -299,7 +299,7 @@ class InvenTreeAPI {
|
||||
if (data == null || !data.containsKey("token")) {
|
||||
showServerError(
|
||||
I18N.of(OneContext().context).tokenMissing,
|
||||
"Access token missing from response"
|
||||
I18N.of(OneContext().context).tokenMissingFromResponse,
|
||||
);
|
||||
|
||||
return false;
|
||||
@ -644,7 +644,7 @@ class InvenTreeAPI {
|
||||
} else {
|
||||
showServerError(
|
||||
I18N.of(OneContext().context).serverCertificateError,
|
||||
"Server HTTPS certificate invalid"
|
||||
I18N.of(OneContext().context).serverCertificateInvalid,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -766,8 +766,8 @@ class InvenTreeAPI {
|
||||
print("${body}");
|
||||
|
||||
showServerError(
|
||||
"Format Exception",
|
||||
"JSON data format exception:\n${body}"
|
||||
I18N.of(OneContext().context).formatException,
|
||||
I18N.of(OneContext().context).formatExceptionJson + ":\n${body}"
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ class BarcodeScanHandler extends BarcodeHandler {
|
||||
title: Text(I18N.of(_context).unknownResponse),
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
title: Text("Response data"),
|
||||
title: Text(I18N.of(_context).responseData),
|
||||
subtitle: Text(data.toString()),
|
||||
)
|
||||
],
|
||||
@ -270,7 +270,10 @@ class StockItemBarcodeAssignmentHandler extends BarcodeHandler {
|
||||
// If the barcode is unknown, we *can* assign it to the stock item!
|
||||
|
||||
if (!data.containsKey("hash")) {
|
||||
showServerError("Missing data", "Barcode hash data missing from response");
|
||||
showServerError(
|
||||
I18N.of(_context).missingData,
|
||||
I18N.of(_context).barcodeMissingHash,
|
||||
);
|
||||
} else {
|
||||
|
||||
// Send the 'hash' code as the UID for the stock item
|
||||
|
Loading…
x
Reference in New Issue
Block a user