Add relations in database event trigger output data (#11820)
## Done - add relations in dropdown variables - add relations in worklfow run inputs - use objectMetadataMaps in workflow folder ## To do - does not work with rest api calls, will be fixed after https://github.com/twentyhq/twenty/pull/11349 is merged - waiting for crud action relation fields https://github.com/twentyhq/core-team-issues/issues/509
This commit is contained in:
+16
-6
@@ -20,6 +20,11 @@ import {
|
||||
} from 'src/modules/workflow/workflow-trigger/exceptions/workflow-trigger.exception';
|
||||
import { WorkflowAutomatedTriggerWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-automated-trigger.workspace-entity';
|
||||
|
||||
export type ObjectMetadataInfo = {
|
||||
objectMetadataItemWithFieldsMaps: ObjectMetadataItemWithFieldMaps;
|
||||
objectMetadataMaps: ObjectMetadataMaps;
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
export class WorkflowCommonWorkspaceService {
|
||||
constructor(
|
||||
@@ -73,13 +78,9 @@ export class WorkflowCommonWorkspaceService {
|
||||
return { ...workflowVersion, trigger: workflowVersion.trigger };
|
||||
}
|
||||
|
||||
async getObjectMetadataItemWithFieldsMaps(
|
||||
objectNameSingular: string,
|
||||
async getObjectMetadataMaps(
|
||||
workspaceId: string,
|
||||
): Promise<{
|
||||
objectMetadataItemWithFieldsMaps: ObjectMetadataItemWithFieldMaps;
|
||||
objectMetadataMaps: ObjectMetadataMaps;
|
||||
}> {
|
||||
): Promise<ObjectMetadataMaps> {
|
||||
const currentCacheVersion =
|
||||
await this.workspaceCacheStorageService.getMetadataVersion(workspaceId);
|
||||
|
||||
@@ -103,6 +104,15 @@ export class WorkflowCommonWorkspaceService {
|
||||
);
|
||||
}
|
||||
|
||||
return objectMetadataMaps;
|
||||
}
|
||||
|
||||
async getObjectMetadataItemWithFieldsMaps(
|
||||
objectNameSingular: string,
|
||||
workspaceId: string,
|
||||
): Promise<ObjectMetadataInfo> {
|
||||
const objectMetadataMaps = await this.getObjectMetadataMaps(workspaceId);
|
||||
|
||||
const objectMetadataItemWithFieldsMaps =
|
||||
getObjectMetadataMapItemByNameSingular(
|
||||
objectMetadataMaps,
|
||||
|
||||
Reference in New Issue
Block a user