コード例 #1
0
        public async Task <IActionResult> SetSubscription(string userGroupId, string userId, string noteType, string noteValue)
        {
            var noteEnabled = noteValue.Equals("true", StringComparison.OrdinalIgnoreCase);

            if (noteType == NotificationType.Email)
            {
                await _userGroupManager.UpdateNotificationGroupSubscriptionAsync(userGroupId, userId, allowEmail : noteEnabled);
            }
            else if (noteType == NotificationType.SMS)
            {
                await _userGroupManager.UpdateNotificationGroupSubscriptionAsync(userGroupId, userId, allowSms : noteEnabled);
            }
            else
            {
                return(BadRequest());
            }
            return(Ok());
        }