public async Task <IActionResult> UpdateClientSetting(UpdateClientSettingAddressModel model) { var currentUser = await GetKahlaUser(); if (model.ThemeId.HasValue) { currentUser.ThemeId = model.ThemeId ?? 0; } if (model.EnableEmailNotification.HasValue) { currentUser.EnableEmailNotification = model.EnableEmailNotification == true; } if (model.EnableEnterToSendMessage.HasValue) { currentUser.EnableEnterToSendMessage = model.EnableEnterToSendMessage == true; } if (model.EnableInvisiable.HasValue) { currentUser.EnableInvisiable = model.EnableInvisiable == true; } if (model.MarkEmailPublic.HasValue) { currentUser.MarkEmailPublic = model.MarkEmailPublic == true; } if (model.ListInSearchResult.HasValue) { currentUser.ListInSearchResult = model.ListInSearchResult == true; } await _userManager.UpdateAsync(currentUser); return(this.Protocol(ErrorType.Success, "Successfully update your client setting.")); }
public async Task <IActionResult> UpdateClientSetting(UpdateClientSettingAddressModel model) { var currentUser = await GetKahlaUser(); currentUser.ThemeId = model.ThemeId; await _userManager.UpdateAsync(currentUser); return(this.Protocol(ErrorType.Success, "Successfully update your client setting.")); }
public async Task <IActionResult> UpdateClientSetting(UpdateClientSettingAddressModel model) { var currentUser = await GetKahlaUser(); if (model.ThemeId != null) { currentUser.ThemeId = model.ThemeId ?? 0; } if (model.EnableEmailNotification != null) { currentUser.EnableEmailNotification = model.EnableEmailNotification ?? false; } await _userManager.UpdateAsync(currentUser); return(this.Protocol(ErrorType.Success, "Successfully update your client setting.")); }