Updated user goes in the end of the table
I have a table, in wich i am fetching the data, also i have a modal that updates the client The problem is that everytime the client gets updates. It goes to the end of the table, basically i need just the update and remain where it was with is my useUpdateClient hook
export const useUpdateClient = () => {
return useMutation((client: UpdateClientObject) => updateClient(client), {
onSuccess: () => {
console.log("User was successfully updated");
queryClient.invalidateQueries(["client"]);
},
onError: () => {
console.log("User was not updated");
},
});
};
I was told to add some queryKeys, not sure what to do here a bit of help would be great
By the way user updates perfectly
0 Replies