fix: self-reference parent page

This commit is contained in:
Philipinho
2026-08-10 17:37:12 +01:00
parent 89378ee766
commit 4bd51d7404
@@ -810,6 +810,10 @@ export class PageService {
throw new BadRequestException('Invalid move position');
}
if (dto.parentPageId && dto.parentPageId === dto.pageId) {
throw new BadRequestException('A page cannot be its own parent');
}
let parentPageId = null;
if (movedPage.parentPageId === dto.parentPageId) {
parentPageId = undefined;