From 9746c26e8bdb075d8417a9d91922a0d603e44f2e Mon Sep 17 00:00:00 2001 From: Samy MOSA Date: Sat, 29 Mar 2025 18:45:36 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20reset=20behavior=20in=20Ed?= =?UTF-8?q?itItem=20mutation=20on=20success?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Items/EditItem.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Items/EditItem.tsx b/frontend/src/components/Items/EditItem.tsx index 49c4eaa0ba..0b36d536b1 100644 --- a/frontend/src/components/Items/EditItem.tsx +++ b/frontend/src/components/Items/EditItem.tsx @@ -56,9 +56,9 @@ const EditItem = ({ item }: EditItemProps) => { const mutation = useMutation({ mutationFn: (data: ItemUpdateForm) => ItemsService.updateItem({ id: item.id, requestBody: data }), - onSuccess: () => { + onSuccess: (_data: ItemPublic, variables: ItemUpdateForm) => { showSuccessToast("Item updated successfully.") - reset() + reset(variables) setIsOpen(false) }, onError: (err: ApiError) => {