recibir la imagen en la api corectamente
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { EditInventory } from "../schemas/inventory";
|
||||
import { updateUserAction, createProductAction } from "../actions/actions";
|
||||
import { updateUserAction, createProductAction, updateUserAction2 } from "../actions/actions";
|
||||
|
||||
// Create mutation
|
||||
export function useCreateUser() {
|
||||
@@ -8,7 +8,6 @@ export function useCreateUser() {
|
||||
const mutation = useMutation({
|
||||
mutationFn: (data: EditInventory) => createProductAction(data),
|
||||
onSuccess: () => queryClient.invalidateQueries({ queryKey: ['product'] }),
|
||||
// onError: (e) => console.error('Error:', e),
|
||||
})
|
||||
return mutation
|
||||
}
|
||||
@@ -17,7 +16,8 @@ export function useCreateUser() {
|
||||
export function useUpdateUser() {
|
||||
const queryClient = useQueryClient();
|
||||
const mutation = useMutation({
|
||||
mutationFn: (data: EditInventory) => updateUserAction(data),
|
||||
// mutationFn: (data: EditInventory) => updateUserAction(data),
|
||||
mutationFn: (data: any) => updateUserAction2(data),
|
||||
onSuccess: () => queryClient.invalidateQueries({ queryKey: ['product'] }),
|
||||
onError: (e) => console.error('Error:', e)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user