public async Task <PromoteSongResponse> PromoteSong(PromoteSongRequest promoteSongRequest) { try { var result = await _playlistClient.PostAsync("PromoteRequest", HttpClientHelper.GetJsonData(promoteSongRequest)); return(JsonConvert.DeserializeObject <PromoteSongResponse>(await result.Content.ReadAsStringAsync())); } catch (Exception e) { return(HttpClientHelper.LogError <PromoteSongResponse>(_logger, e, new object[] { promoteSongRequest.Username })); } }
public async Task <IActionResult> PromoteRequest([FromBody] PromoteSongRequest promoteSongRequest) { try { var result = await _playlistService.PromoteRequest(promoteSongRequest.Username, promoteSongRequest.SongRequestId, promoteSongRequest.UseSuperVip).ConfigureAwait(false); return(new JsonResult(result)); } catch (Exception e) { _logger.LogError(e, "Error in PromoteWebRequest", promoteSongRequest); return(BadRequest()); } }