Fix ORM (#6363)
This PR fixes a few bugs on TwentyORM: - fix many to one relations that were not properly queries - fix many to one relations that were not properly parsed - compute datasource (or use from cache) at run-time and do not use injected one that could be outdated We still need to refactor it to simplify, I feel the API are too complex and we have too many cache layers. Also the relation computation part is very complex and bug prone
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { Scope } from '@nestjs/common';
|
||||
|
||||
import { WorkspaceService } from 'src/engine/core-modules/workspace/services/workspace.service';
|
||||
import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator';
|
||||
import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator';
|
||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
||||
@ -19,6 +20,7 @@ export type CalendarEventParticipantMatchParticipantJobData = {
|
||||
export class CalendarEventParticipantMatchParticipantJob {
|
||||
constructor(
|
||||
private readonly calendarEventParticipantService: CalendarEventParticipantService,
|
||||
private readonly workspaceService: WorkspaceService,
|
||||
) {}
|
||||
|
||||
@Process(CalendarEventParticipantMatchParticipantJob.name)
|
||||
@ -27,6 +29,10 @@ export class CalendarEventParticipantMatchParticipantJob {
|
||||
): Promise<void> {
|
||||
const { workspaceId, email, personId, workspaceMemberId } = data;
|
||||
|
||||
if (!this.workspaceService.isWorkspaceActivated(workspaceId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.calendarEventParticipantService.matchCalendarEventParticipants(
|
||||
workspaceId,
|
||||
email,
|
||||
|
||||
Reference in New Issue
Block a user