mirror of
https://github.com/docmost/docmost.git
synced 2026-08-15 10:21:36 +10:00
fix issues
This commit is contained in:
@@ -13,7 +13,7 @@ export enum WorkspaceCaslSubject {
|
||||
Attachment = 'attachment',
|
||||
API = 'api_key',
|
||||
Audit = 'audit',
|
||||
PageAnalytics = "page_analytics"
|
||||
PageAnalytics = 'page_analytics'
|
||||
}
|
||||
|
||||
export type IWorkspaceAbility =
|
||||
|
||||
@@ -51,7 +51,8 @@ export class ShareController {
|
||||
private readonly pageAccessService: PageAccessService,
|
||||
private readonly licenseCheckService: LicenseCheckService,
|
||||
@Inject(AUDIT_SERVICE) private readonly auditService: IAuditService,
|
||||
@Inject(PAGE_VIEW_SERVICE) private readonly pageViewService: IPageViewService,
|
||||
@Inject(PAGE_VIEW_SERVICE)
|
||||
private readonly pageViewService: IPageViewService,
|
||||
) {}
|
||||
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@@ -76,14 +77,6 @@ export class ShareController {
|
||||
|
||||
const shareData = await this.shareService.getSharedPage(dto, workspace.id);
|
||||
|
||||
void this.pageViewService.track({
|
||||
pageId: shareData.page.id,
|
||||
workspaceId: workspace.id,
|
||||
spaceId: shareData.page.spaceId,
|
||||
shareId: shareData.share.id,
|
||||
userId: null,
|
||||
});
|
||||
|
||||
const sharingAllowed = await this.shareService.isSharingAllowed(
|
||||
workspace.id,
|
||||
shareData.share.spaceId,
|
||||
@@ -92,6 +85,14 @@ export class ShareController {
|
||||
throw new NotFoundException('Shared page not found');
|
||||
}
|
||||
|
||||
void this.pageViewService.track({
|
||||
pageId: shareData.page.id,
|
||||
workspaceId: workspace.id,
|
||||
spaceId: shareData.page.spaceId,
|
||||
shareId: shareData.share.id,
|
||||
userId: null,
|
||||
});
|
||||
|
||||
return {
|
||||
...shareData,
|
||||
features: this.licenseCheckService.resolveFeatures(
|
||||
|
||||
@@ -16,6 +16,10 @@ export async function up(db: Kysely<any>): Promise<void> {
|
||||
.addColumn('space_id', 'uuid', (col) =>
|
||||
col.references('spaces.id').onDelete('cascade'),
|
||||
)
|
||||
.addColumn('user_id', 'uuid', (col) =>
|
||||
col.references('users.id').onDelete('set null'),
|
||||
)
|
||||
.addColumn('share_id', 'uuid')
|
||||
.addColumn('visitor_id', 'varchar', (col) => col.notNull())
|
||||
.addColumn('view_date', 'varchar', (col) => col.notNull())
|
||||
.addColumn('hits', 'int8', (col) => col.notNull().defaultTo(1))
|
||||
|
||||
Reference in New Issue
Block a user