Changed error booking
This commit is contained in:
parent
3b18833356
commit
39011afea7
@ -7,6 +7,7 @@ import * as Yup from "yup";
|
||||
import { Input, Submit } from "formstrap";
|
||||
import { callAPI } from "../../../actions/API";
|
||||
import Msgbox from "../../../actions/Msgbox";
|
||||
import { buildErrorStringFromArray } from "../../../actions/Error";
|
||||
// import FormikFieldDateTimePicker from "./FormikFieldDateTimePicker";
|
||||
|
||||
// Main form and POST Request to add migrations
|
||||
@ -67,13 +68,12 @@ export const CPanelBooking = () => {
|
||||
callAPI
|
||||
.post("/", values)
|
||||
.then(function (response) {
|
||||
console.log(response.data.id);
|
||||
// console.log(response);
|
||||
// add function here
|
||||
setRespID(response.data.id)
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
setError(error)
|
||||
setError(buildErrorStringFromArray(error.response.data))
|
||||
});
|
||||
setSubmitting(false);
|
||||
resetForm({ values: "" });
|
||||
|
||||
@ -5,6 +5,7 @@ import { Formik, Form } from "formik";
|
||||
import { Input, Submit } from "formstrap";
|
||||
import { callAPI } from "../../../actions/API";
|
||||
import Msgbox from "../../../actions/Msgbox";
|
||||
import { buildErrorStringFromArray } from "../../../actions/Error";
|
||||
|
||||
// Main form element for the UUID linking Migrations page,
|
||||
// Contians the PUT request to modify data from the API
|
||||
@ -37,10 +38,10 @@ const ReportSingleMigration = ({ item }) => {
|
||||
.then(function (response) {
|
||||
console.log(JSON.stringify(response.values));
|
||||
setRespID(response.data.ticket_id);
|
||||
setError(0)
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
setError(error);
|
||||
setError(buildErrorStringFromArray(error.response.data));
|
||||
});
|
||||
setSubmitting(false);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user