mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(server): should check doc public attribute when snapshot not exists (#12913)
close CLOUD-232 #### PR Dependency Tree * **PR #12913** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - The visibility status of documents now accurately reflects their public status instead of always showing as private. - **Tests** - Added an end-to-end test to verify correct handling of the public attribute for documents without snapshots. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -304,11 +304,13 @@ export class WorkspaceDocResolver {
|
||||
|
||||
await this.tryFixDocOwner(workspace.id, docId);
|
||||
|
||||
const isPublic = await this.models.doc.isPublic(workspace.id, docId);
|
||||
|
||||
return {
|
||||
docId,
|
||||
workspaceId: workspace.id,
|
||||
mode: PublicDocMode.Page,
|
||||
public: false,
|
||||
public: isPublic,
|
||||
defaultRole: DocRole.Manager,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user