Skip to content

Commit

Permalink
BC-7367 - fix domain object reference in board copy (#5160)
Browse files Browse the repository at this point in the history
  • Loading branch information
uidp authored and virgilchiriac committed Aug 2, 2024
1 parent f07201d commit eb914aa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/server/src/modules/board/domain/board-node.do.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ export abstract class BoardNode<T extends BoardNodeProps> extends DomainObject<T
});
}

public getProps(): T {
const copyProps = { ...this.props };
// TODO This is a Hotfix. We need to make sure that only properties of type T are returned
// At runtime the props are a MikroORM entity that has additional non-persisted properties
// see @Property({ persist: false })
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
copyProps.domainObject = undefined;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
copyProps.children = [];

return copyProps;
}

get level(): number {
return this.ancestorIds.length;
}
Expand Down

0 comments on commit eb914aa

Please sign in to comment.