Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.

Commit

Permalink
Use object id to get feedback directly
Browse files Browse the repository at this point in the history
  • Loading branch information
tang3w committed May 9, 2017
1 parent 8c5f1e7 commit 722082b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions LeanCloudFeedback/LCUserFeedbackThread.m
Expand Up @@ -82,16 +82,16 @@ +(void)fetchFeedbackWithBlock:(LCUserFeedbackBlock)block {
block(nil, nil);
} else {
LCHttpClient *client = [LCHttpClient sharedInstance];
[client getObject:[LCUserFeedbackThread objectPath] withParameters:@{@"objectId":feedbackObjectId} block:^(id object, NSError *error) {
NSString *path = [[LCUserFeedbackThread objectPath] stringByAppendingPathComponent:feedbackObjectId];
[client getObject:path withParameters:nil block:^(id object, NSError *error) {
if (error) {
[LCUtils callIdResultBlock:block object:nil error:error];
} else {
NSArray* results = [(NSDictionary*)object objectForKey:@"results"];
if (results.count == 0) {
[LCUtils callIdResultBlock:block object:nil error:nil];
} else {
LCUserFeedbackThread *feedback = [[LCUserFeedbackThread alloc] initWithDictionary:results[0]];
if (object) {
LCUserFeedbackThread *feedback = [[LCUserFeedbackThread alloc] initWithDictionary:object];
[LCUtils callIdResultBlock:block object:feedback error:nil];
} else {
[LCUtils callIdResultBlock:block object:nil error:nil];
}
}
}];
Expand Down

0 comments on commit 722082b

Please sign in to comment.