Skip to content

Commit

Permalink
fix(UseDeleteFormContainerMutation): Ensure to delete all children of…
Browse files Browse the repository at this point in the history
… container components when the container is deleted. (#12357)

* fix(UseDeleteFormContainerMutation): ensure to delete child components from layouts
  • Loading branch information
framitdavid authored and standeren committed Feb 21, 2024
1 parent 67785a8 commit 22a80f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const useDeleteFormContainerMutation = (org: string, app: string, layoutS
// Todo: Consider if this should rather be done in the backend
for (const componentId of layout.order[id]) {
if (Object.keys(layout.components).indexOf(componentId) > -1) {
delete updatedLayout.components[componentId];
delete updatedLayout.containers[componentId];
delete updatedLayout.order[componentId];
updatedLayout.order[id].splice(updatedLayout.order[id].indexOf(componentId), 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const useDeleteFormContainerMutation = (org: string, app: string, layoutS
// Todo: Consider if this should rather be done in the backend
for (const componentId of layout.order[id]) {
if (Object.keys(layout.components).indexOf(componentId) > -1) {
delete updatedLayout.components[componentId];
delete updatedLayout.containers[componentId];
delete updatedLayout.order[componentId];
updatedLayout.order[id].splice(updatedLayout.order[id].indexOf(componentId), 1);
Expand Down

0 comments on commit 22a80f3

Please sign in to comment.