mirror of
https://github.com/idanoo/autobrr
synced 2025-07-24 01:09:13 +00:00
parent
e0aaa0bcab
commit
286f2f53f7
20 changed files with 61 additions and 63 deletions
|
@ -7,9 +7,8 @@ import Select, { components, ControlProps, InputProps, MenuProps, OptionProps }
|
|||
import { PasswordFieldWide, SwitchGroupWide, TextFieldWide } from "../../components/inputs";
|
||||
import DEBUG from "../../components/debug";
|
||||
import { EventOptions, NotificationTypeOptions, SelectOption } from "../../domain/constants";
|
||||
import { useMutation } from "react-query";
|
||||
import { useMutation, useQueryClient } from "react-query";
|
||||
import { APIClient } from "../../api/APIClient";
|
||||
import { queryClient } from "../../App";
|
||||
import { toast } from "react-hot-toast";
|
||||
import Toast from "../../components/notifications/Toast";
|
||||
import { SlideOver } from "../../components/panels";
|
||||
|
@ -136,6 +135,8 @@ interface AddProps {
|
|||
}
|
||||
|
||||
export function NotificationAddForm({ isOpen, toggle }: AddProps) {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const mutation = useMutation(
|
||||
(notification: Notification) => APIClient.notifications.create(notification),
|
||||
{
|
||||
|
@ -407,6 +408,8 @@ interface InitialValues {
|
|||
}
|
||||
|
||||
export function NotificationUpdateForm({ isOpen, toggle, notification }: UpdateProps) {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const mutation = useMutation(
|
||||
(notification: Notification) => APIClient.notifications.update(notification),
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue