4643 create a pre hook for calendar events (#4666)
* copy message pre hook * add CalendarQueryHookModule to workspace-pre-query-hook.module * use CalendarChannelVisibility enum * add calendarEvent to workspace-pre-query-hook.config * fix pre-hook * fix findOne prehook in config * rename fragments * fix import * update findOne prehook and create can-access-calendar-event.provider * replace provider with service * fix type * renaming * remove unnecessary eslint skip --------- Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import { MessageFindManyPreQueryHook } from 'src/modules/messaging/query-hooks/message/message-find-many.pre-query.hook';
|
||||
import { MessageFindOnePreQueryHook } from 'src/modules/messaging/query-hooks/message/message-find-one.pre-query-hook';
|
||||
import { WorkspaceQueryHook } from 'src/engine/api/graphql/workspace-query-runner/workspace-pre-query-hook/types/workspace-query-hook.type';
|
||||
import { CalendarEventFindManyPreQueryHook } from 'src/modules/calendar/query-hooks/calendar-event/calendar-event-find-many.pre-query.hook';
|
||||
import { CalendarEventFindOnePreQueryHook } from 'src/modules/calendar/query-hooks/calendar-event/calendar-event-find-one.pre-query-hook';
|
||||
|
||||
// TODO: move to a decorator
|
||||
export const workspacePreQueryHooks: WorkspaceQueryHook = {
|
||||
@ -8,4 +10,8 @@ export const workspacePreQueryHooks: WorkspaceQueryHook = {
|
||||
findOne: [MessageFindOnePreQueryHook.name],
|
||||
findMany: [MessageFindManyPreQueryHook.name],
|
||||
},
|
||||
calendarEvent: {
|
||||
findOne: [CalendarEventFindOnePreQueryHook.name],
|
||||
findMany: [CalendarEventFindManyPreQueryHook.name],
|
||||
},
|
||||
};
|
||||
|
||||
@ -2,9 +2,10 @@ import { Module } from '@nestjs/common';
|
||||
|
||||
import { MessagingQueryHookModule } from 'src/modules/messaging/query-hooks/messaging-query-hook.module';
|
||||
import { WorkspacePreQueryHookService } from 'src/engine/api/graphql/workspace-query-runner/workspace-pre-query-hook/workspace-pre-query-hook.service';
|
||||
import { CalendarQueryHookModule } from 'src/modules/calendar/query-hooks/calendar-query-hook.module';
|
||||
|
||||
@Module({
|
||||
imports: [MessagingQueryHookModule],
|
||||
imports: [MessagingQueryHookModule, CalendarQueryHookModule],
|
||||
providers: [WorkspacePreQueryHookService],
|
||||
exports: [WorkspacePreQueryHookService],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user