mirror of
https://github.com/docmost/docmost.git
synced 2026-08-19 18:44:09 +08:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca3c9dcfd7 | ||
|
|
436f257ef7 |
@@ -7,12 +7,15 @@ import { executeTx } from '@docmost/db/utils';
|
||||
import { PaginationOptions } from '@docmost/db/pagination/pagination-options';
|
||||
import { PagePermissionRepo } from '@docmost/db/repos/page/page-permission.repo';
|
||||
import { normalizeLabelName } from './utils';
|
||||
import { EventEmitter2 } from "@nestjs/event-emitter";
|
||||
import { EventName } from "src/common/events/event.contants";
|
||||
|
||||
@Injectable()
|
||||
export class LabelService {
|
||||
constructor(
|
||||
private readonly labelRepo: LabelRepo,
|
||||
private readonly pagePermissionRepo: PagePermissionRepo,
|
||||
private readonly eventEmitter: EventEmitter2,
|
||||
@InjectKysely() private readonly db: KyselyDB,
|
||||
) {}
|
||||
|
||||
@@ -34,6 +37,12 @@ export class LabelService {
|
||||
attached.push(label);
|
||||
}
|
||||
});
|
||||
|
||||
this.eventEmitter.emit(EventName.PAGE_UPDATED, {
|
||||
pageIds: [pageId],
|
||||
workspaceId: workspaceId,
|
||||
});
|
||||
|
||||
return attached;
|
||||
}
|
||||
|
||||
@@ -64,6 +73,11 @@ export class LabelService {
|
||||
await this.labelRepo.deleteLabel(labelId, workspaceId, trx);
|
||||
}
|
||||
});
|
||||
|
||||
this.eventEmitter.emit(EventName.PAGE_UPDATED, {
|
||||
pageIds: [pageId],
|
||||
workspaceId: workspaceId,
|
||||
});
|
||||
}
|
||||
|
||||
async getPageLabels(pageId: string, pagination: PaginationOptions) {
|
||||
|
||||
+1
@@ -312,6 +312,7 @@ export interface PageHistory {
|
||||
export interface Pages {
|
||||
content: Json | null;
|
||||
contributorIds: Generated<string[] | null>;
|
||||
labelIds: Generated<string[] | null>;
|
||||
coverPhoto: string | null;
|
||||
createdAt: Generated<Timestamp>;
|
||||
creatorId: string | null;
|
||||
|
||||
+1
-1
Submodule apps/server/src/ee updated: 433ed9d646...54bafd9a14
Reference in New Issue
Block a user