Closed seanmturley closed 1 year ago
Implemented postLoader function, and abstracted the common API request code from the two loader functions into a new makeApiRequest function.
Added the getPost endpoint to the redditApi, with a simple transformation of the response to surface post and comment data.
Added accessing of the response data to the Post component.
Description
Implement the API endpoint and corresponding loader function.
Implementation details
The API call needs to be made to www.reddit.com/r/[subreddit]/comments/[postID]/[abbreviated_post_title].json
The entire path is available in the permalink property of a post as pulled from e.g. the subreddit API endpoint, and it's sufficient to simply add ".json" to the end (the trailing "/" before the ".json" doesn't affect the response).