endpoint name fixed for exported flows

This commit is contained in:
anovazzi1 2024-06-17 14:34:20 -03:00
commit 300f93dec4
2 changed files with 15 additions and 3 deletions

View file

@ -232,7 +232,6 @@ const useFlowsManagerStore = create<FlowsManagerStoreType>((set, get) => ({
// addFlowToLocalState(newFlow);
return;
}
console.log("folder id", folder_id);
const newFlow = createNewFlow(
flowData!,
flow!,
@ -263,8 +262,20 @@ const useFlowsManagerStore = create<FlowsManagerStoreType>((set, get) => ({
// Return the id
return id;
} catch (error) {
// Handle the error if needed
} catch (error:any) {
console.error(error);
if(error.response?.data?.detail){
useAlertStore.getState().setErrorData({
title: "Could not load flows from database",
list: [error.response?.data?.detail],
});
}
else{
useAlertStore.getState().setErrorData({
title: "Could not load flows from database",
list: [error.message?? "An unexpected error occurred, please try again"],
});
}
throw error; // Re-throw the error so the caller can handle it if needed
}
} else {

View file

@ -1452,6 +1452,7 @@ export const createNewFlow = (
id: "",
is_component: flow?.is_component ?? false,
folder_id: folderId,
endpoint_name:flow?.endpoint_name ?? undefined,
};
};