mirror of
https://github.com/docmost/docmost.git
synced 2026-08-24 17:42:15 +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');
|
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;
|
let parentPageId = null;
|
||||||
if (movedPage.parentPageId === dto.parentPageId) {
|
if (movedPage.parentPageId === dto.parentPageId) {
|
||||||
parentPageId = undefined;
|
parentPageId = undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user