public async Task UpdateTwitchLink(int eventId, UpdateTwtichLinkCommand command) { var ev = await _dbContext.Events.FirstOrDefaultAsync(); if (ev == null) { throw new HttpStatusCodeException(HttpStatusCode.NotFound); } ev.TwitchLink = command.Url; await _dbContext.SaveChangesAsync(); }
public async Task <IActionResult> SetTwitchLink([FromRoute] int id, [FromBody] UpdateTwtichLinkCommand command) { await _eventService.UpdateTwitchLink(id, command); return(Ok()); }