Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments: add REST endpoint to fetch a single comment #486

Merged
merged 8 commits into from
Feb 4, 2022

Conversation

ScoutHarris
Copy link
Contributor

@ScoutHarris ScoutHarris commented Feb 3, 2022

Description

Ref: wordpress-mobile/WordPress-iOS#17790
WPiOS PR: wordpress-mobile/WordPress-iOS#17890

This adds the /sites/$site/comments/$comment_ID endpoint to CommentServiceRemoteREST so a single comment can be fetched. (It already existed in CommentServiceRemoteXMLRPC.)

Testing Details

  • Verify the tests pass on this PR.
  • Functionality can be tested with the referenced WPiOS PR.

  • Please check here if your pull request includes additional test coverage.
  • I have considered updating the version in the .podspec file.

@ScoutHarris ScoutHarris self-assigned this Feb 3, 2022
Copy link
Contributor

@frosty frosty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two small nitpicks here!

*/
- (void)getCommentWithID:(NSNumber *)commentID
success:(void (^)(RemoteComment *comment))success
failure:(void (^)(NSError *))failure;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error could have a name here to match other declarations like the one above (same for the method implementation in the .m)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops. Fixed!

parameters:nil
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
RemoteComment *comment = [self remoteCommentFromJSONDictionary:responseObject];
if (success) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a little more concise as success?(comment). Same for the failure call below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in ObjC. 😄

@ScoutHarris
Copy link
Contributor Author

Thanks @frosty !

@ScoutHarris ScoutHarris merged commit 79afe58 into trunk Feb 4, 2022
@ScoutHarris ScoutHarris deleted the feature/17790-fetch_single_comment branch February 4, 2022 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants