Updated error handling
This commit is contained in:
parent
7aea3080b6
commit
faab2fd921
@ -5,7 +5,7 @@ import { Formik, Form } from "formik";
|
|||||||
import { Input, Submit } from "formstrap";
|
import { Input, Submit } from "formstrap";
|
||||||
import { callAPI } from "../../../actions/API";
|
import { callAPI } from "../../../actions/API";
|
||||||
import Msgbox from "../../../actions/Msgbox";
|
import Msgbox from "../../../actions/Msgbox";
|
||||||
import { buildErrorStringFromArray } from "../../../actions/Error";
|
import { builfArrayFromObject } from "../../../actions/Error";
|
||||||
|
|
||||||
// Main form element for the UUID linking Migrations page,
|
// Main form element for the UUID linking Migrations page,
|
||||||
// Contians the PUT request to modify data from the API
|
// Contians the PUT request to modify data from the API
|
||||||
@ -38,11 +38,11 @@ const ReportSingleMigration = ({ item }) => {
|
|||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
console.log(JSON.stringify(response.values));
|
console.log(JSON.stringify(response.values));
|
||||||
setRespID(response.data.ticket_id);
|
setRespID(response.data.ticket_id);
|
||||||
setError(0)
|
setError(0);
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
setError(buildErrorStringFromArray(error.response.data));
|
setError(builfArrayFromObject(error.response.data));
|
||||||
setRespID(0)
|
setRespID(0);
|
||||||
});
|
});
|
||||||
setSubmitting(false);
|
setSubmitting(false);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user