File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/packages/core/content-type/structure Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -425,10 +425,15 @@ export class UmbContentTypeStructureManager<
425
425
throw new Error ( 'Could not find the Content Type to remove container from' ) ;
426
426
}
427
427
const frozenContainers = contentType . containers ?? [ ] ;
428
+ const removedContainerIds = frozenContainers
429
+ . filter ( ( x ) => x . id === containerId || x . parent ?. id === containerId )
430
+ . map ( ( x ) => x . id ) ;
428
431
const containers = frozenContainers . filter ( ( x ) => x . id !== containerId && x . parent ?. id !== containerId ) ;
429
432
430
- const frozenProperties = contentType . properties ?? [ ] ;
431
- const properties = frozenProperties . filter ( ( x ) => x . container ?. id !== containerId ) ;
433
+ const frozenProperties = contentType . properties ;
434
+ const properties = frozenProperties . filter ( ( x ) =>
435
+ x . container ? ! removedContainerIds . some ( ( ids ) => ids === x . container ?. id ) : true ,
436
+ ) ;
432
437
433
438
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
434
439
// @ts -ignore
You can’t perform that action at this time.
0 commit comments