(id: number)
| 75 | } |
| 76 | |
| 77 | const getPostById = async (id: number): Promise<Post> => { |
| 78 | const response = await fetch( |
| 79 | `https://jsonplaceholder.typicode.com/posts/${id}`, |
| 80 | ) |
| 81 | return await response.json() |
| 82 | } |
| 83 | |
| 84 | function usePost(postId: number) { |
| 85 | return useQuery({ |