foolish-indigoF
Refine3y ago
25 replies
foolish-indigo

Why useDelete calls getIdentity from auth-provider?

Hey there. I'm facing a wired problem. I have a table that has an actions column with a delete button that calls useDelete under the hood. Apparantly each time this button rendered (for each row) it calls ["getUserIdentity"] query. You can see in the first image that the query is subscribed in 12 places, when I remote the delete button it becoms 2.

Why useDelete needs to know the user identity? I've looks at the code but can't find where you call getIdentity from auth-provider.

This is the delete button, just calls useDelete, nothing fancy:
const DeleteButton = () => {
  const { mutate } = useDelete();
  return (
    <button onClick={() => mutate({ resource: "users", id: 1 })}>delete</button>
  );
};
2023-10-20_10-30.png
Was this page helpful?