Skip to content
Snippets Groups Projects
Commit 621c306f authored by Robin Leber's avatar Robin Leber
Browse files

Fix: clear Model

parent 7a5344cb
No related branches found
No related tags found
No related merge requests found
...@@ -100,6 +100,25 @@ export const clearArchitecture = async () => { ...@@ -100,6 +100,25 @@ export const clearArchitecture = async () => {
}); });
}; };
export const clearModel = async () => {
loader(true);
await axios
.get(`${SERVER_URL}/customCode/clear`)
.then((response) => {
loader(false);
if (response.status === 200) {
successFeedback();
} else {
errorFeedback(response);
}
})
.catch((error) => {
loader(false);
errorFeedback(error);
console.error(error);
});
};
export const scaleOut = async (id) => { export const scaleOut = async (id) => {
const requestBody = { id }; const requestBody = { id };
loader(true); loader(true);
......
...@@ -11,6 +11,7 @@ import { ...@@ -11,6 +11,7 @@ import {
stopCustomCode, stopCustomCode,
restartCustomCode, restartCustomCode,
clearArchitecture, clearArchitecture,
clearModel,
} from "./functions/api"; } from "./functions/api";
import { getScaleValues } from "./functions/scaling"; import { getScaleValues } from "./functions/scaling";
import { showAllWarning } from "./functions/visualValidation"; import { showAllWarning } from "./functions/visualValidation";
...@@ -106,6 +107,7 @@ function App() { ...@@ -106,6 +107,7 @@ function App() {
"#Diagram .Filter, #Diagram .Pipe, .jtk-endpoint, .jtk-connector" "#Diagram .Filter, #Diagram .Pipe, .jtk-endpoint, .jtk-connector"
); );
elements.forEach((element) => element.remove()); elements.forEach((element) => element.remove());
await clearModel();
}); });
killDeploymentElement.addEventListener("click", async () => { killDeploymentElement.addEventListener("click", async () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment