updateTemplate migration done
This commit is contained in:
parent
4c9dc55205
commit
db8f5a74d3
1 changed files with 0 additions and 24 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue