feat(extraSidebarComponent): add FlowType to saveFlow object to improve type safety and include flow name, id, and description in the saved flow data

This commit is contained in:
anovazzi1 2023-10-23 17:37:08 -03:00
commit 550e1ef8ef

View file

@ -13,6 +13,7 @@ import ApiModal from "../../../../modals/ApiModal";
import ConfirmationModal from "../../../../modals/ConfirmationModal";
import ExportModal from "../../../../modals/exportModal";
import { APIClassType, APIObjectType } from "../../../../types/api";
import { FlowType } from "../../../../types/flow";
import {
nodeColors,
nodeIconsLucide,
@ -106,7 +107,10 @@ export default function ExtraSidebar(): JSX.Element {
const handleShareFlow = () => {
const reactFlow = flow!.data as ReactFlowJsonObject;
const saveFlow = {
const saveFlow: FlowType = {
name: flow!.name,
id: flow!.id,
description: flow!.description,
data: {
...reactFlow,
},