fixed:fixed folder name queries and remove unnessary comment
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { blogService, IBlogQueryParams } from "@/api/services/blog.service";
|
||||
import { queryKeys } from "@/utils/queryKeys";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
|
||||
export const useBlogs = (params?: IBlogQueryParams) => {
|
||||
return useQuery({
|
||||
queryKey: [...queryKeys.blogs, params],
|
||||
queryFn: () => blogService.getBlogs(params),
|
||||
});
|
||||
};
|
||||
|
||||
export const useBlogById = (id: string) => {
|
||||
return useQuery({
|
||||
queryKey: queryKeys.blog(id),
|
||||
queryFn: () => blogService.getBlogById(id),
|
||||
enabled: !!id,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user