Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nilumilak committed May 3, 2024
1 parent 210d40c commit 6515571
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions frontend/src/lib/hooks/api/kafkaConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,18 @@ export function useConnectorTasks(props: UseConnectorProps) {
}
export function useUpdateConnectorState(clusterName: ClusterName) {
const client = useQueryClient();
return useMutation(
({

return useMutation({
mutationFn: ({
props,
action,
}: {
props: UseConnectorProps;
action: ConnectorAction;
}) => api.updateConnectorState({ ...props, action }),
{
onSuccess: async () =>
client.invalidateQueries(['clusters', clusterName, 'connectors']),
}
);
onSuccess: () =>
client.invalidateQueries(['clusters', clusterName, 'connectors']),
});
}
export function useRestartConnectorTask(props: UseConnectorProps) {
const client = useQueryClient();
Expand Down Expand Up @@ -163,10 +162,9 @@ export function useCreateConnector(clusterName: ClusterName) {
export function useDeleteConnector(clusterName: ClusterName) {
const client = useQueryClient();

return useMutation(
({ props }: { props: UseConnectorProps }) => api.deleteConnector(props),
{
onSuccess: () => client.invalidateQueries(connectorsKey(clusterName)),
}
);
return useMutation({
mutationFn: ({ props }: { props: UseConnectorProps }) =>
api.deleteConnector(props),
onSuccess: () => client.invalidateQueries(connectorsKey(clusterName)),
});
}

0 comments on commit 6515571

Please sign in to comment.