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

fix: add custom code bug

parent 870f9a39
Branches
No related tags found
No related merge requests found
......@@ -55,12 +55,14 @@ const addCustomCodeToJson = async (newElement) => {
const existingFilter = customCodes.find(
(element) => element.id === newElement.id
);
if (existingFilter) {
if (existingFilter && existingFilter.isDeployed) {
await killDockerContainer(newElement.id);
await removeDockerContainer(newElement.id);
await removeDockerImage(newElement.id);
existingFilter.code = newElement.code;
existingFilter.isDeployed = false;
} else if (existingFilter && !existingFilter.isDeployed) {
existingFilter.code = newElement.code;
} else {
customCodes.push(newElement);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment