Exemple #1
0
        public async Task <IActionResult> Edit([FromRoute] int id, [FromBody] EditBoardRequestDTO dto)
        {
            await _commandDispatcher.DispatchAsync(
                new EditBoardCommandHandler.Command {
                UserId = GetUser().ID, BoardId = id, Name = dto.Name
            });

            return(Json(new ApiJsonResponse(ApiMessage.Info($"Board name has been changed"))));
        }
Exemple #2
0
        public async Task <IActionResult> Create([FromBody] CreateBoardRequestDTO dto)
        {
            var command = new CreateBoardCommandHandler.Command
            {
                UserId         = GetUser().ID,
                Name           = dto.Name,
                ParticipantIds = dto.ParticipantIds
            };
            await _commandDispatcher.DispatchAsync(command);

            return(Json(new ApiJsonResponse(command.BoardId, ApiMessage.Info($"'{dto.Name}' board has been created"))));
        }