Skip to content

Commit 9746c26

Browse files
committed
🐛 Fix reset behavior in EditItem mutation on success
1 parent 9f2c3d2 commit 9746c26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/components/Items/EditItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ const EditItem = ({ item }: EditItemProps) => {
5656
const mutation = useMutation({
5757
mutationFn: (data: ItemUpdateForm) =>
5858
ItemsService.updateItem({ id: item.id, requestBody: data }),
59-
onSuccess: () => {
59+
onSuccess: (_data: ItemPublic, variables: ItemUpdateForm) => {
6060
showSuccessToast("Item updated successfully.")
61-
reset()
61+
reset(variables)
6262
setIsOpen(false)
6363
},
6464
onError: (err: ApiError) => {

0 commit comments

Comments
 (0)