TanStackT
TanStack3y ago
4 replies
standard-azure

Error from axios how to handle it

Here is the mutation query
export const createWorkspaceMutation = async (data: createWorkspaceFormData): Promise<createWorkspaceApiResponse> => {
  const response = await axiosinstance.post<createWorkspaceApiResponse>("/api/createworkspace", data);
  return response.data;
};


if i get a 401 in response, how to handle that, does it will be get caught by react query or i have to handle it within the mutation function.. im confused a bit about this...
Was this page helpful?