mirror of
https://github.com/docmost/docmost.git
synced 2026-05-09 15:53:10 +08:00
lint
This commit is contained in:
@@ -407,7 +407,6 @@
|
||||
"Share deleted successfully": "Share deleted successfully",
|
||||
"Share not found": "Share not found",
|
||||
"Failed to share page": "Failed to share page",
|
||||
"Public Sharing": "Public Sharing",
|
||||
"Disable public sharing": "Disable public sharing",
|
||||
"Prevent members from sharing pages publicly.": "Prevent members from sharing pages publicly.",
|
||||
"Toggle public sharing": "Toggle public sharing",
|
||||
|
||||
@@ -202,7 +202,10 @@ export class ShareController {
|
||||
@Body() dto: ShareIdDto,
|
||||
@AuthWorkspace() workspace: Workspace,
|
||||
) {
|
||||
const treeData = await this.shareService.getShareTree(dto.shareId, workspace.id);
|
||||
const treeData = await this.shareService.getShareTree(
|
||||
dto.shareId,
|
||||
workspace.id,
|
||||
);
|
||||
|
||||
const sharingAllowed = await this.shareService.isSharingAllowed(
|
||||
workspace.id,
|
||||
|
||||
@@ -264,7 +264,10 @@ export class ShareService {
|
||||
return ancestor;
|
||||
}
|
||||
|
||||
async isSharingAllowed(workspaceId: string, spaceId: string): Promise<boolean> {
|
||||
async isSharingAllowed(
|
||||
workspaceId: string,
|
||||
spaceId: string,
|
||||
): Promise<boolean> {
|
||||
const result = await this.db
|
||||
.selectFrom('workspaces')
|
||||
.innerJoin('spaces', 'spaces.workspaceId', 'workspaces.id')
|
||||
@@ -278,8 +281,10 @@ export class ShareService {
|
||||
|
||||
if (!result) return false;
|
||||
|
||||
const workspaceDisabled = (result.workspaceSettings as any)?.sharing?.disabled === true;
|
||||
const spaceDisabled = (result.spaceSettings as any)?.sharing?.disabled === true;
|
||||
const workspaceDisabled =
|
||||
(result.workspaceSettings as any)?.sharing?.disabled === true;
|
||||
const spaceDisabled =
|
||||
(result.spaceSettings as any)?.sharing?.disabled === true;
|
||||
|
||||
return !workspaceDisabled && !spaceDisabled;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user