|
@@ -319,17 +319,26 @@ class NCService: NSObject {
|
|
|
|
|
|
private func requestHC() {
|
|
|
|
|
|
- let professions = CCUtility.getHCBusinessType(appDelegate.activeAccount)
|
|
|
+ let professions = CCUtility.getHCBusinessType("")
|
|
|
if professions != nil && professions!.count > 0 {
|
|
|
-
|
|
|
+ OCNetworking.sharedManager()?.putHCUserProfile(withAccount: appDelegate.activeAccount, serverUrl: appDelegate.activeUrl, professions: professions, completion: { (account, message, errorCode) in
|
|
|
+ if errorCode == 0 && account == self.appDelegate.activeAccount {
|
|
|
+ CCUtility.setHCBusinessType("", professions: nil)
|
|
|
+ OCNetworking.sharedManager()?.getHCUserProfile(withAccount: self.appDelegate.activeAccount, serverUrl: self.appDelegate.activeUrl, completion: { (account, userProfile, message, errorCode) in
|
|
|
+ if errorCode == 0 && account == self.appDelegate.activeAccount {
|
|
|
+ _ = NCManageDatabase.sharedInstance.setAccountUserProfile(userProfile!)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ OCNetworking.sharedManager()?.getHCUserProfile(withAccount: appDelegate.activeAccount, serverUrl: appDelegate.activeUrl, completion: { (account, userProfile, message, errorCode) in
|
|
|
+ if errorCode == 0 && account == self.appDelegate.activeAccount {
|
|
|
+ _ = NCManageDatabase.sharedInstance.setAccountUserProfile(userProfile!)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
- OCNetworking.sharedManager()?.getHCUserProfile(withAccount: appDelegate.activeAccount, serverUrl: appDelegate.activeUrl, completion: { (account, userProfile, message, errorCode) in
|
|
|
- if errorCode == 0 && account == self.appDelegate.activeAccount {
|
|
|
- _ = NCManageDatabase.sharedInstance.setAccountUserProfile(userProfile!)
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
OCNetworking.sharedManager()?.getHCFeatures(withAccount: appDelegate.activeAccount, serverUrl: appDelegate.activeUrl, completion: { (account, features, message, errorCode) in
|
|
|
if errorCode == 0 && account == self.appDelegate.activeAccount {
|
|
|
}
|