Skip to content

Commit

Permalink
update generate add node request
Browse files Browse the repository at this point in the history
  • Loading branch information
alicenstar committed Oct 18, 2023
1 parent 0e6db85 commit 766e089
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions web/src/components/apps/HelmVMClusterManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@ const HelmVMClusterManagement = ({
isLoading: generateAddNodeCommandLoading,
// error: generateAddNodeCommandError,
} = useQuery({
queryKey: "generateAddNodeCommand",
queryFn: async () => {
queryKey: ["generateAddNodeCommand", selectedNodeTypes],
queryFn: async ({ queryKey }) => {
const [, selectedNodeTypes] = queryKey;

Check failure on line 213 in web/src/components/apps/HelmVMClusterManagement.tsx

View workflow job for this annotation

GitHub Actions / lint-web

'selectedNodeTypes' is already declared in the upper scope on line 129 column 10
return (
await fetch(
`${process.env.API_ENDPOINT}/helmvm/generate-node-join-command`,
Expand All @@ -221,12 +222,13 @@ const HelmVMClusterManagement = ({
credentials: "include",
method: "POST",
body: JSON.stringify({
roles: selectedNodeTypes.join(","),
roles: selectedNodeTypes,
}),
}
)
).json();
},
enabled: selectedNodeTypes.length > 0,
});

// TODO: import useMutation
Expand Down

0 comments on commit 766e089

Please sign in to comment.