コード例 #1
0
        public async Task <IActionResult> SetSafeStatus([FromBody] ResponseSafeUpdateModel responseSafeUpdateObj)
        {
            string userId = UserHelper.GetBestClaimValue(User.Claims.ToList(), _config.ClaimsId, true).ToLower();

            bool result = await _responseDataManager.SetSafeStatus(userId, responseSafeUpdateObj.IsSafe);

            return(Ok(result));
        }
コード例 #2
0
        public async Task <bool> SetSafeStatus(ResponseSafeUpdateModel responseSafeUpdateObj)
        {
            RestRequest request = await PrepareQuery("Responses/Sage", Method.PUT);

            request.AddParameter("application/json", JsonConvert.SerializeObject(responseSafeUpdateObj), ParameterType.RequestBody);
            var queryResult = await _client.ExecuteTaskAsync <bool>(request);

            if (queryResult.IsSuccessful)
            {
                return(queryResult.Data);
            }
            else
            {
                _logger.LogError($"SetSafeStatus: Error while adding action to response: {queryResult.StatusCode}");
            }
            return(false);
        }