示例#1
0
        public async Task <ActionResult <WatchlistSummaryDto> > UpdateWatchlist(int watchlistId, [FromBody] WatchlistSummaryDto dto)
        {
            var newName = dto.name;

            if (string.IsNullOrWhiteSpace(newName))
            {
                return(new BadRequestObjectResult(Errors.AddErrorToModelState("", ModelState)));
            }

            var watchlist = await _watchlistService.RenameAsync(GetUserId(), watchlistId, newName);

            return(new OkObjectResult(watchlist));
        }