From faab2fd9211c56b207687ba622ffdb31aed81b19 Mon Sep 17 00:00:00 2001 From: pepper Date: Tue, 19 Jan 2021 01:25:01 -0500 Subject: [PATCH] Updated error handling --- src/components/root/common/Forms/ReportSingleMigration.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/root/common/Forms/ReportSingleMigration.js b/src/components/root/common/Forms/ReportSingleMigration.js index d8e0247..56db012 100644 --- a/src/components/root/common/Forms/ReportSingleMigration.js +++ b/src/components/root/common/Forms/ReportSingleMigration.js @@ -5,7 +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"; +import { builfArrayFromObject } from "../../../actions/Error"; // Main form element for the UUID linking Migrations page, // Contians the PUT request to modify data from the API @@ -38,11 +38,11 @@ const ReportSingleMigration = ({ item }) => { .then(function (response) { console.log(JSON.stringify(response.values)); setRespID(response.data.ticket_id); - setError(0) + setError(0); }) .catch(function (error) { - setError(buildErrorStringFromArray(error.response.data)); - setRespID(0) + setError(builfArrayFromObject(error.response.data)); + setRespID(0); }); setSubmitting(false); };