+
{headerGroups.map((headerGroup) =>
headerGroup.headers.map((column) => (
column.Filter ? (
diff --git a/web/src/screens/settings/DownloadClient.tsx b/web/src/screens/settings/DownloadClient.tsx
index 189cc2a..1f2c049 100644
--- a/web/src/screens/settings/DownloadClient.tsx
+++ b/web/src/screens/settings/DownloadClient.tsx
@@ -1,11 +1,13 @@
import { useToggle } from "../../hooks/hooks";
import { Switch } from "@headlessui/react";
-import { useQuery } from "react-query";
+import { useMutation, useQuery, useQueryClient } from "react-query";
import { classNames } from "../../utils";
import { DownloadClientAddForm, DownloadClientUpdateForm } from "../../forms";
import { EmptySimple } from "../../components/emptystates";
import { APIClient } from "../../api/APIClient";
import { DownloadClientTypeNameMap } from "../../domain/constants";
+import toast from "react-hot-toast";
+import Toast from "../../components/notifications/Toast";
interface DLSettingsItemProps {
client: DownloadClient;
@@ -15,14 +17,35 @@ interface DLSettingsItemProps {
function DownloadClientSettingsListItem({ client, idx }: DLSettingsItemProps) {
const [updateClientIsOpen, toggleUpdateClient] = useToggle(false);
+ const queryClient = useQueryClient();
+ const mutation = useMutation(
+ (client: DownloadClient) => APIClient.download_clients.update(client),
+ {
+ onSuccess: () => {
+ queryClient.invalidateQueries(["downloadClients"]);
+ toast.custom((t) => );
+ }
+ }
+ );
+
+ const onToggleMutation = (newState: boolean) => {
+ mutation.mutate({
+ ...client,
+ enabled: newState
+ });
+ };
+
return (
-
-
+
|