fix(codeAreaModal): move postCustomComponent call outside of the else block to ensure it is always executed

This commit is contained in:
anovazzi1 2023-07-04 15:51:32 -03:00
commit 0d6293de17

View file

@ -104,14 +104,14 @@ export default function CodeAreaModal({
}
else
{
postCustomComponent(code, nodeClass).then((apiReturn) => {
const {data} = apiReturn;
if (data) {
setNodeClass(data);
setModalOpen(false);
}
});
}
postCustomComponent(code, nodeClass).then((apiReturn) => {
const {data} = apiReturn;
if (data) {
setNodeClass(data);
setModalOpen(false);
}
});
// axios.get("/api/v1/custom_component_error").catch((err) => {
// console.log(err.response.data);
// setError(err.response.data);