Skip to content

Commit

Permalink
rm query category
Browse files Browse the repository at this point in the history
  • Loading branch information
bugswritter committed Jun 27, 2024
1 parent 6061197 commit 06fece2
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/hooks/Queries/shop/useSwagList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,4 @@ const useSingleSwag = (id) =>
refetchOnWindowFocus: false,
});

const fetchCategorySwags = async (name) => {
try {
const response = await publicAxios.get(`/swaggs/?category=${name}`);
return response.data;
} catch (error) {
console.error("Error fetching category list: ", error);
throw error;
}
};
const useCategorySwag = (name) =>
useQuery({
queryKey: ["category swag"],
queryFn: () => fetchCategorySwags(name),
refetchOnWindowFocus: false,
});

export { useSwagList, useSingleSwag, useCategorySwag };
export { useSwagList, useSingleSwag };

0 comments on commit 06fece2

Please sign in to comment.