IO-70 Add basic functions of OEC.

This commit is contained in:
Patrick Fic
2021-11-29 15:04:34 -08:00
parent 53be0bbc1a
commit 5db43dd065
9 changed files with 87 additions and 11 deletions

View File

@@ -228,7 +228,6 @@ export function PartsOrderModalContainer({
id: insertResult.data.insert_parts_orders.returning[0].id,
},
});
console.log("🚀 ~ file: parts-order-modal.container.jsx ~ line 231 ~ handleFinish ~ partsOrder", partsOrder)
const oecResponse = await axios.post(
"http://localhost:1337/oec/",
@@ -240,11 +239,17 @@ export function PartsOrderModalContainer({
},
}
);
console.log(
"🚀 ~ file: parts-order-modal.container.jsx ~ line 232 ~ handleFinish ~ oecResponse",
oecResponse
);
return;
if (oecResponse.data && oecResponse.data.success === false) {
notification.open({
type: "error",
message: t("parts_orders.errors.oec", {
error: oecResponse.data.error,
}),
});
}
} catch (error) {
console.log("Error OEC.", error);
notification["error"]({