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