fix(indexers): test API button (#844)

fix(indexers): api test button
This commit is contained in:
ze0s 2023-04-16 18:50:23 +02:00 committed by GitHub
parent e0aaa0bcab
commit 286f2f53f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 61 additions and 63 deletions

View file

@ -1,11 +1,10 @@
import React, { Fragment, useRef, useState } from "react";
import { useMutation } from "react-query";
import { useMutation, useQueryClient } from "react-query";
import { Dialog, Transition } from "@headlessui/react";
import { XMarkIcon } from "@heroicons/react/24/solid";
import { classNames, sleep } from "../../utils";
import { Form, Formik, useFormikContext } from "formik";
import DEBUG from "../../components/debug";
import { queryClient } from "../../App";
import { APIClient } from "../../api/APIClient";
import { DownloadClientTypeOptions, DownloadRuleConditionOptions } from "../../domain/constants";
@ -516,6 +515,8 @@ export function DownloadClientAddForm({ isOpen, toggle }: formProps) {
const [isSuccessfulTest, setIsSuccessfulTest] = useState(false);
const [isErrorTest, setIsErrorTest] = useState(false);
const queryClient = useQueryClient();
const mutation = useMutation(
(client: DownloadClient) => APIClient.download_clients.create(client),
{
@ -691,6 +692,8 @@ export function DownloadClientUpdateForm({ client, isOpen, toggle }: updateFormP
const [isErrorTest, setIsErrorTest] = useState(false);
const [deleteModalIsOpen, toggleDeleteModal] = useToggle(false);
const queryClient = useQueryClient();
const mutation = useMutation(
(client: DownloadClient) => APIClient.download_clients.update(client),
{