2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 10:15:32 +00:00

Display error message when form submission returns error

This commit is contained in:
Oliver
2021-08-15 13:44:27 +10:00
parent cae6dd412c
commit 81602512a5
4 changed files with 13 additions and 5 deletions

View File

@ -540,7 +540,7 @@ class InvenTreeAPI {
* Perform a HTTP POST request
* Returns a json object (or null if unsuccessful)
*/
Future<APIResponse> post(String url, {Map<String, dynamic> body = const {}, int expectedStatusCode=201}) async {
Future<APIResponse> post(String url, {Map<String, dynamic> body = const {}, int? expectedStatusCode=201}) async {
HttpClientRequest? request = await apiRequest(url, "POST");
@ -763,7 +763,7 @@ class InvenTreeAPI {
* Perform a HTTP GET request
* Returns a json object (or null if did not complete)
*/
Future<APIResponse> get(String url, {Map<String, String> params = const {}, int expectedStatusCode=200}) async {
Future<APIResponse> get(String url, {Map<String, String> params = const {}, int? expectedStatusCode=200}) async {
HttpClientRequest? request = await apiRequest(
url,