fix: meta title for shared subpages (#2478)

This commit is contained in:
Philip Okugbe
2026-09-07 16:43:02 +01:00
committed by GitHub
parent 89e27a1a07
commit 0a87db4f1f
2 changed files with 28 additions and 14 deletions
+15 -6
View File
@@ -110,7 +110,11 @@ export class ShareService {
}
}
async getSharedPage(dto: ShareInfoDto, workspaceId: string) {
async getSharedPage(
dto: ShareInfoDto,
workspaceId: string,
opts?: { includeContent?: boolean },
) {
//TODO: we should resolve the page from the share id
if (!dto.pageId) throw new NotFoundException('Shared page not found');
@@ -120,10 +124,13 @@ export class ShareService {
throw new NotFoundException('Shared page not found');
}
const page = await this.pageRepo.findById(dto.pageId, {
includeContent: true,
includeCreator: true,
});
const includeContent = opts?.includeContent !== false;
const page = includeContent
? await this.pageRepo.findById(dto.pageId, {
includeContent: true,
includeCreator: true,
})
: await this.pageRepo.findById(dto.pageId);
if (!page || page.deletedAt) {
throw new NotFoundException('Shared page not found');
@@ -137,7 +144,9 @@ export class ShareService {
throw new NotFoundException('Shared page not found');
}
page.content = await this.updatePublicAttachments(page);
if (includeContent) {
page.content = await this.updatePublicAttachments(page);
}
return { page, share };
}