mirror of
https://github.com/docmost/docmost.git
synced 2026-08-15 07:11:35 +10:00
fix: self-reference parent page
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user