Skip to content

Commit 8585af9

Browse files
committed
Fix add flow not adding the flow that comes from the backend
1 parent cde102d commit 8585af9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/frontend/src/hooks/flows/use-add-flow.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ const useAddFlow = () => {
6464
newFlow.folder_id = folder_id;
6565

6666
postAddFlow(newFlow, {
67-
onSuccess: ({ id }) => {
68-
newFlow.id = id;
67+
onSuccess: (createdFlow) => {
6968
// Add the new flow to the list of flows.
7069
const { data, flows: myFlows } = processFlows([
71-
newFlow,
70+
createdFlow,
7271
...(flows ?? []),
7372
]);
7473
setFlows(myFlows);
@@ -79,7 +78,7 @@ const useAddFlow = () => {
7978
["saved_components"]: data,
8079
}),
8180
}));
82-
resolve(id);
81+
resolve(createdFlow.id);
8382
},
8483
onError: (error) => {
8584
if (error.response?.data?.detail) {

0 commit comments

Comments
 (0)