refactor(core): Move methods from WorkflowHelpers into various workflow services (no-changelog) (#8348)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-01-17 10:16:13 +01:00
committed by GitHub
parent ab52aaf7e9
commit 7cdbb424e3
21 changed files with 896 additions and 802 deletions

View File

@@ -11,6 +11,15 @@ export class WorkflowStaticDataService {
private readonly workflowRepository: WorkflowRepository,
) {}
/** Returns the static data of workflow */
async getStaticDataById(workflowId: string) {
const workflowData = await this.workflowRepository.findOne({
select: ['staticData'],
where: { id: workflowId },
});
return workflowData?.staticData ?? {};
}
/** Saves the static data if it changed */
async saveStaticData(workflow: Workflow): Promise<void> {
if (workflow.staticData.__dataChanged === true) {