landing api
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getBlogs } from "../service/BlogService";
|
||||
|
||||
// برای client
|
||||
export const useGetBlogs = () =>
|
||||
useQuery({
|
||||
queryKey: ["blogs"],
|
||||
queryFn: getBlogs,
|
||||
});
|
||||
|
||||
// برای server prefetch
|
||||
export const blogsQueryOptions = {
|
||||
queryKey: ["blogs"],
|
||||
queryFn: getBlogs,
|
||||
};
|
||||
Reference in New Issue
Block a user