public BaseResponse <BoardOutputDto> Create(BoardInputDto boardInputDto, Guid userId) { var board = Create(Mapper.Map <Board>(boardInputDto), out var isSaved); if (!isSaved) { throw new InternalServerErrorException(string.Format(Error.CreateError, boardInputDto.Name)); } var boardUser = new BoardUser { UserId = userId, BoardId = board.Id, MemberType = BoardMemberType.Admin }; _boardUserService.Create(boardUser, out isSaved); if (!isSaved) { Delete(board); throw new InternalServerErrorException($"Could not add board role admin for user {userId}"); } return(new SuccessResponse <BoardOutputDto>(Mapper.Map <BoardOutputDto>(board))); }
public BaseResponse <bool> Update([FromBody] BoardInputDto boardInputDto) { return(_boardService.Update(boardInputDto)); }
public BaseResponse <BoardOutputDto> Create([FromBody] BoardInputDto boardInputDto) { var userId = User.GetUserId(); return(_boardService.Create(boardInputDto, userId)); }
public BaseResponse <bool> Update(BoardInputDto boardInputDto) { var isSaved = Update(Mapper.Map <Board>(boardInputDto)); return(new SuccessResponse <bool>(isSaved)); }