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")) {
|
if (data == null || !data.containsKey("server") || !data.containsKey("version") || !data.containsKey("instance")) {
|
||||||
|
|
||||||
showServerError(
|
showServerError(
|
||||||
"Missing Data",
|
I18N.of(ctx).missingData,
|
||||||
"Server response missing required fields"
|
I18N.of(ctx).serverMissingData,
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -283,7 +283,7 @@ class InvenTreeAPI {
|
|||||||
case 403:
|
case 403:
|
||||||
showServerError(
|
showServerError(
|
||||||
I18N.of(ctx).serverAuthenticationError,
|
I18N.of(ctx).serverAuthenticationError,
|
||||||
"Incorrect username:password combination"
|
I18N.of(ctx).invalidUsernamePassword,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -299,7 +299,7 @@ class InvenTreeAPI {
|
|||||||
if (data == null || !data.containsKey("token")) {
|
if (data == null || !data.containsKey("token")) {
|
||||||
showServerError(
|
showServerError(
|
||||||
I18N.of(OneContext().context).tokenMissing,
|
I18N.of(OneContext().context).tokenMissing,
|
||||||
"Access token missing from response"
|
I18N.of(OneContext().context).tokenMissingFromResponse,
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -644,7 +644,7 @@ class InvenTreeAPI {
|
|||||||
} else {
|
} else {
|
||||||
showServerError(
|
showServerError(
|
||||||
I18N.of(OneContext().context).serverCertificateError,
|
I18N.of(OneContext().context).serverCertificateError,
|
||||||
"Server HTTPS certificate invalid"
|
I18N.of(OneContext().context).serverCertificateInvalid,
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -766,8 +766,8 @@ class InvenTreeAPI {
|
|||||||
print("${body}");
|
print("${body}");
|
||||||
|
|
||||||
showServerError(
|
showServerError(
|
||||||
"Format Exception",
|
I18N.of(OneContext().context).formatException,
|
||||||
"JSON data format exception:\n${body}"
|
I18N.of(OneContext().context).formatExceptionJson + ":\n${body}"
|
||||||
);
|
);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ class BarcodeScanHandler extends BarcodeHandler {
|
|||||||
title: Text(I18N.of(_context).unknownResponse),
|
title: Text(I18N.of(_context).unknownResponse),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text("Response data"),
|
title: Text(I18N.of(_context).responseData),
|
||||||
subtitle: Text(data.toString()),
|
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 the barcode is unknown, we *can* assign it to the stock item!
|
||||||
|
|
||||||
if (!data.containsKey("hash")) {
|
if (!data.containsKey("hash")) {
|
||||||
showServerError("Missing data", "Barcode hash data missing from response");
|
showServerError(
|
||||||
|
I18N.of(_context).missingData,
|
||||||
|
I18N.of(_context).barcodeMissingHash,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Send the 'hash' code as the UID for the stock item
|
// Send the 'hash' code as the UID for the stock item
|
||||||
|
Loading…
x
Reference in New Issue
Block a user