buildTweaks migration done

This commit is contained in:
anovazzi1 2023-07-13 19:31:00 -03:00
commit 28c0b35fd7
4 changed files with 11 additions and 9 deletions

View file

@ -3,7 +3,8 @@
import { MessageSquare } from "lucide-react";
import { FlowType } from "./types/flow";
import { TabsState } from "./types/tabs";
import { buildInputs, buildTweaks } from "./utils";
import { buildInputs } from "./utils";
import { buildTweaks } from "./utils/reactflowUtils";
/**
* constants fpr programming languages box on chat form

View file

@ -51,8 +51,8 @@ import {
import { darkContext } from "../../contexts/darkContext";
import { TabsContext } from "../../contexts/tabsContext";
import { FlowType } from "../../types/flow/index";
import { buildTweaks, classNames } from "../../utils";
import { classNames } from "../../utils";
import { buildTweaks } from "../../utils/reactflowUtils";
export default function ApiModal({ flow }: { flow: FlowType }) {
const [open, setOpen] = useState(true);
const { dark } = useContext(darkContext);

View file

@ -209,12 +209,6 @@ export function buildInputs(tabsState, id) {
: '{"input": "message"}';
}
export function buildTweaks(flow) {
return flow.data.nodes.reduce((acc, node) => {
acc[node.data.id] = {};
return acc;
}, {});
}
export function validateNode(
n: NodeType,
reactFlowInstance: ReactFlowInstance

View file

@ -159,3 +159,10 @@ export function updateIds(newFlow, getNodeId) {
e.targetHandle;
});
}
export function buildTweaks(flow) {
return flow.data.nodes.reduce((acc, node) => {
acc[node.data.id] = {};
return acc;
}, {});
}