예제 #1
0
        public IActionResult EditQuote([FromBody] EditQuoteRequest editRequest)
        {
            try
            {
                _quoteService.EditQuote(editRequest.QuoteId, editRequest.QuoteText, editRequest.Username, editRequest.IsMod);

                return(Ok());
            }
            catch (Exception e)
            {
                _logger.Log(LogLevel.Error, e, "Error when editing quote", editRequest);
                return(BadRequest());
            }
        }
예제 #2
0
        public async Task <bool> EditQuote(EditQuoteRequest request)
        {
            try
            {
                var result = await _quoteClient.PostAsync("EditQuote",
                                                          HttpClientHelper.GetJsonData(request));

                return(result.IsSuccessStatusCode);
            }
            catch (Exception e)
            {
                return(HttpClientHelper.LogError <bool>(_logger, e,
                                                        new object[] { request.Username, request.QuoteId, request.QuoteText }));
            }
        }