summaryrefslogtreecommitdiff
path: root/Juick/Model/User.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-01 20:45:54 +0300
committerGravatar Vitaly Takmazov2018-11-01 20:45:54 +0300
commitebee043d87d1ceae6ebe7cad8225c96470762c1e (patch)
tree813846d239bf0444d112afce6f281e94b4be1066 /Juick/Model/User.m
parent9a0a039c5df78526bba67f6bef93e431cf94430a (diff)
Local and Production Debug configurations
Diffstat (limited to 'Juick/Model/User.m')
-rw-r--r--Juick/Model/User.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Juick/Model/User.m b/Juick/Model/User.m
index 1576a91..36a9b4c 100644
--- a/Juick/Model/User.m
+++ b/Juick/Model/User.m
@@ -32,7 +32,7 @@
+(void) checkIsValid:(void (^)(BOOL))callback {
AFHTTPSessionManager *manager = [APIClient sharedClient].manager;
[manager.requestSerializer setAuthorizationHeaderFieldWithUsername:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] password:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.password"]];
- [manager POST:@"/post" parameters:nil progress:nil success:nil failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
+ [manager POST:@"post" parameters:nil progress:nil success:nil failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
NSInteger statusCode = ((NSHTTPURLResponse *)task.response).statusCode;
if (statusCode == 400) {
callback(YES);
@@ -45,7 +45,7 @@
+(void) get:(NSString *) name callback:(void(^)(User *))callback {
AFHTTPSessionManager *manager = [APIClient sharedClient].manager;
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:name, @"uname", nil];
- [manager GET:@"/users" parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
+ [manager GET:@"users" parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
callback([User yy_modelWithJSON:[(NSArray *)responseObject firstObject]]);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
callback(nil);