fix(filters): correct toasts for enabling and disabling filters (#912)

correct toasts for enabling and disabling filters
This commit is contained in:
soup 2023-05-06 16:12:59 +02:00 committed by GitHub
parent 8a1910843c
commit 7817e85621
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -652,8 +652,7 @@ function FilterListItem({ filter, values, idx }: FilterListItemProps) {
const updateMutation = useMutation({
mutationFn: (status: boolean) => APIClient.filters.toggleEnable(filter.id, status),
onSuccess: () => {
toast.custom((t) => <Toast type="success" body={`${filter.name} was ${!filter.enabled ? "disabled" : "enabled"} successfully`} t={t} />);
toast.custom((t) => <Toast type="success" body={`${filter.name} was ${filter.enabled ? "disabled" : "enabled"} successfully`} t={t} />);
// We need to invalidate both keys here.
// The filters key is used on the /filters page,
// while the ["filter", filter.id] key is used on the details page.