(postId)
| 14 | } |
| 15 | |
| 16 | export const fetchPost = async (postId) => { |
| 17 | console.info(`Fetching post with id ${postId}...`) |
| 18 | const post = await axios |
| 19 | .get(`${queryURL}/posts/${postId}`) |
| 20 | .then((r) => r.data) |
| 21 | |
| 22 | if (!post) { |
| 23 | throw new NotFoundError(`Post with id "${postId}" not found!`) |
| 24 | } |
| 25 | |
| 26 | return post |
| 27 | } |
no test coverage detected