♻️ Tweaks in frontend (#1273)

This commit is contained in:
Alejandra
2024-08-01 13:01:03 -05:00
committed by GitHub
parent 93e83c1ad4
commit b905768656
15 changed files with 186 additions and 126 deletions

View File

@@ -22,6 +22,7 @@ import {
ItemsService,
} from "../../client"
import useCustomToast from "../../hooks/useCustomToast"
import { handleError } from "../../utils"
interface EditItemProps {
item: ItemPublic
@@ -51,8 +52,7 @@ const EditItem = ({ item, isOpen, onClose }: EditItemProps) => {
onClose()
},
onError: (err: ApiError) => {
const errDetail = (err.body as any)?.detail
showToast("Something went wrong.", `${errDetail}`, "error")
handleError(err, showToast)
},
onSettled: () => {
queryClient.invalidateQueries({ queryKey: ["items"] })