feat: manually implement joinColumn (#6022)
This PR introduce a new decorator named `@WorkspaceJoinColumn`, the goal
of this one is to manually declare the join columns inside the workspace
entities, so we don't have to rely on `ObjectRecord` type.
This decorator can be used that way:
```typescript
@WorkspaceRelation({
standardId: ACTIVITY_TARGET_STANDARD_FIELD_IDS.company,
type: RelationMetadataType.MANY_TO_ONE,
label: 'Company',
description: 'ActivityTarget company',
icon: 'IconBuildingSkyscraper',
inverseSideTarget: () => CompanyWorkspaceEntity,
inverseSideFieldKey: 'activityTargets',
})
@WorkspaceIsNullable()
company: Relation<CompanyWorkspaceEntity> | null;
// The argument is the name of the relation above
@WorkspaceJoinColumn('company')
companyId: string | null;
```
This commit is contained in:
@ -34,9 +34,7 @@ export class CalendarEventFindManyPreQueryHook
|
||||
const calendarChannelCalendarEventAssociations =
|
||||
await this.calendarChannelEventAssociationRepository.find({
|
||||
where: {
|
||||
calendarEvent: {
|
||||
id: payload?.filter?.id?.eq,
|
||||
},
|
||||
calendarEventId: payload?.filter?.id?.eq,
|
||||
},
|
||||
relations: ['calendarChannel.connectedAccount'],
|
||||
});
|
||||
|
||||
@ -35,9 +35,7 @@ export class CalendarEventFindOnePreQueryHook
|
||||
const calendarChannelCalendarEventAssociations =
|
||||
await this.calendarChannelEventAssociationRepository.find({
|
||||
where: {
|
||||
calendarEvent: {
|
||||
id: payload?.filter?.id?.eq,
|
||||
},
|
||||
calendarEventId: payload?.filter?.id?.eq,
|
||||
},
|
||||
relations: ['calendarChannel.connectedAccount'],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user