From db8f5a74d375b5d8fa175aef59f94a349dde3328 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 13 Jul 2023 18:40:38 -0300 Subject: [PATCH] updateTemplate migration done --- src/frontend/src/utils.ts | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/frontend/src/utils.ts b/src/frontend/src/utils.ts index 8e9b6cb64..2b488d54e 100644 --- a/src/frontend/src/utils.ts +++ b/src/frontend/src/utils.ts @@ -3,7 +3,6 @@ import _ from "lodash"; import { ReactFlowInstance } from "reactflow"; import { twMerge } from "tailwind-merge"; import { ADJECTIVES, DESCRIPTIONS, NOUNS } from "./flow_constants"; -import { APITemplateType } from "./types/api"; import { IVarHighlightType } from "./types/components"; import { NodeType } from "./types/flow"; @@ -101,29 +100,6 @@ export function debounce(func, wait) { }; } -export function updateTemplate( - reference: APITemplateType, - objectToUpdate: APITemplateType -): APITemplateType { - let clonedObject: APITemplateType = _.cloneDeep(reference); - - // Loop through each key in the reference object - for (const key in clonedObject) { - // If the key is not in the object to update, add it - if (objectToUpdate[key] && objectToUpdate[key].value) { - clonedObject[key].value = objectToUpdate[key].value; - } - if ( - objectToUpdate[key] && - objectToUpdate[key].advanced !== null && - objectToUpdate[key].advanced !== undefined - ) { - clonedObject[key].advanced = objectToUpdate[key].advanced; - } - } - return clonedObject; -} - interface languageMap { [key: string]: string | undefined; }