Skip to content

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Дмитрий Куртеев committed Jun 26, 2014
1 parent 8ef50fd commit 29c1650
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion AFAbstractRESTClient/AbstractGETAPICall.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

@interface AbstractGETAPICall : NSObject

- (void) executeAPICallWithSuccessBlock:(void (^)(NSHTTPURLResponse *response, id responseObject)) blockSuccess failure:(void (^)(NSError *error, id responseObject)) blockFailure;
- (void) executeAPICallWithSuccessBlock:(void (^)(NSHTTPURLResponse *response, id responseObject)) blockSuccess failure:(void (^)(NSError *error, NSHTTPURLResponse *response, id responseObject)) blockFailure;

@end
4 changes: 2 additions & 2 deletions AFAbstractRESTClient/AbstractGETAPICall.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@implementation AbstractGETAPICall

- (void) executeAPICallWithSuccessBlock:(void (^)(NSHTTPURLResponse *response, id responseObject)) blockSuccess failure:(void (^)(NSError *error, id responseObject)) blockFailure {
- (void) executeAPICallWithSuccessBlock:(void (^)(NSHTTPURLResponse *response, id responseObject)) blockSuccess failure:(void (^)(NSError *error, NSHTTPURLResponse *response, id responseObject)) blockFailure {
NETWORK_ON;

NSDictionary *params = [self queryParams];
Expand All @@ -38,7 +38,7 @@ - (void) executeAPICallWithSuccessBlock:(void (^)(NSHTTPURLResponse *response, i
NSLog(@"executeAPICall FAILURE body: %@\n\n", [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding]);
NSLog(@"executeAPICall FAILURE error: %@\n",error);

if (blockFailure != nil) blockFailure(error, JSON);
if (blockFailure != nil) blockFailure(error, response, JSON);

NETWORK_OFF;

Expand Down
2 changes: 1 addition & 1 deletion AFAbstractRESTClient/AbstractPOSTAPICall.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ extern NSString *const kServerURLString;

@interface AbstractPOSTAPICall : NSObject

- (void) executeAPICallWithSuccessBlock:(void (^)(NSHTTPURLResponse *response, id responseObject)) blockSuccess failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error)) blockFailure progress: (void (^)(long long totalBytesWritten, long long totalBytesExpectedToWrite)) blockProgress;
- (void) executeAPICallWithSuccessBlock:(void (^)(NSHTTPURLResponse *response, id responseObject)) blockSuccess failure:(void (^)(AFHTTPRequestOperation *operation, NSHTTPURLResponse *response, NSError *error)) blockFailure progress: (void (^)(long long totalBytesWritten, long long totalBytesExpectedToWrite)) blockProgress;

@end
4 changes: 2 additions & 2 deletions AFAbstractRESTClient/AbstractPOSTAPICall.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@implementation AbstractPOSTAPICall

- (void) executeAPICallWithSuccessBlock:(void (^)(NSHTTPURLResponse *response, id responseObject)) blockSuccess failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error)) blockFailure progress: (void (^)(long long totalBytesWritten, long long totalBytesExpectedToWrite)) blockProgress {
- (void) executeAPICallWithSuccessBlock:(void (^)(NSHTTPURLResponse *response, id responseObject)) blockSuccess failure:(void (^)(AFHTTPRequestOperation *operation, NSHTTPURLResponse *response, NSError *error)) blockFailure progress: (void (^)(long long totalBytesWritten, long long totalBytesExpectedToWrite)) blockProgress {
NETWORK_ON;

AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:kServerURLString]];
Expand Down Expand Up @@ -52,7 +52,7 @@ - (void) executeAPICallWithSuccessBlock:(void (^)(NSHTTPURLResponse *response, i
NSLog(@"executeAPICall FAILURE body: %@\n\n", [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding]);
NSLog(@"executeAPICall FAILURE error: %@\n",error);

if (blockFailure) blockFailure(operation, error);
if (blockFailure) blockFailure(operation, [operation response], error);

NETWORK_OFF;

Expand Down

0 comments on commit 29c1650

Please sign in to comment.