-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
There was a problem hiding this 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!
WordPressKit/CommentServiceRemote.h
Outdated
*/ | ||
- (void)getCommentWithID:(NSNumber *)commentID | ||
success:(void (^)(RemoteComment *comment))success | ||
failure:(void (^)(NSError *))failure; |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in ObjC. 😄
Thanks @frosty ! |
Description
Ref: wordpress-mobile/WordPress-iOS#17790
WPiOS PR: wordpress-mobile/WordPress-iOS#17890
This adds the
/sites/$site/comments/$comment_ID
endpoint toCommentServiceRemoteREST
so a single comment can be fetched. (It already existed inCommentServiceRemoteXMLRPC
.)Testing Details
version
in the.podspec
file.