refactor(server): use DocModel to access doc meta (#10593)
This commit is contained in:
@@ -72,7 +72,7 @@ test('should render page success', async t => {
|
||||
text.insert(5, ' ');
|
||||
|
||||
await adapter.pushDocUpdates(workspace.id, docId, updates, user.id);
|
||||
await models.workspace.publishDoc(workspace.id, docId);
|
||||
await models.doc.publish(workspace.id, docId);
|
||||
|
||||
await app.GET(`/workspace/${workspace.id}/${docId}`).expect(200);
|
||||
t.pass();
|
||||
|
||||
@@ -102,10 +102,7 @@ export class DocRendererController {
|
||||
workspaceId: string,
|
||||
docId: string
|
||||
): Promise<RenderOptions | null> {
|
||||
let allowUrlPreview = await this.models.workspace.isPublicPage(
|
||||
workspaceId,
|
||||
docId
|
||||
);
|
||||
let allowUrlPreview = await this.models.doc.isPublic(workspaceId, docId);
|
||||
|
||||
if (!allowUrlPreview) {
|
||||
// if page is private, but workspace url preview is on
|
||||
|
||||
Reference in New Issue
Block a user