1
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
#import "KBUser.h"
|
||||
#import "KBAPI.h"
|
||||
|
||||
NSString * const KBUserCharacterDeletedNotification = @"KBUserCharacterDeletedNotification";
|
||||
|
||||
@implementation KBMyVM
|
||||
|
||||
- (void)fetchUserDetailWithCompletion:(KBMyUserDetailCompletion)completion {
|
||||
@@ -111,7 +113,6 @@
|
||||
}
|
||||
|
||||
NSDictionary *params = @{@"id": characterId};
|
||||
[KBHUD show];
|
||||
[[KBNetworkManager shared] GET:API_CHARACTER_DEL_USER_CHARACTER
|
||||
parameters:params
|
||||
headers:nil
|
||||
@@ -119,9 +120,20 @@
|
||||
completion:^(NSDictionary *jsonOrData,
|
||||
NSURLResponse * _Nullable response,
|
||||
NSError * _Nullable error) {
|
||||
[KBHUD dismiss];
|
||||
BOOL success = (error == nil);
|
||||
|
||||
if (success) {
|
||||
// 通知 App 内其他页面(如 HomeRankContentVC / HomeHotVC)该人设已被删除
|
||||
NSDictionary *info = @{@"characterId": characterId ?: @0};
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:KBUserCharacterDeletedNotification
|
||||
object:nil
|
||||
userInfo:info];
|
||||
});
|
||||
}
|
||||
|
||||
if (completion) {
|
||||
completion(error == nil, error);
|
||||
completion(success, error);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user