(id: number)
| 82 | } |
| 83 | |
| 84 | const getPostById = async (id: number): Promise<Post> => { |
| 85 | const response = await fetch( |
| 86 | `https://jsonplaceholder.typicode.com/posts/${id}`, |
| 87 | ) |
| 88 | return await response.json() |
| 89 | } |
| 90 | |
| 91 | function usePost(postId: number) { |
| 92 | return useQuery({ |