Beispiel #1
0
        public async Task <IActionResult> CreateChannelAsync([FromBody] TransportModels.Request.Channel.CreateChannelRequest request)
        {
            var createChannelRequest = new CreateChannelRequest(GetCurrentSaasUserId(), request.Name, request.Type)
            {
                AllowedMembers = request.AllowedMembers,
                Description    = request.Description,
                PhotoUrl       = request.PhotoUrl,
                WelcomeMessage = request.WelcomeMessage
            };
            var channel = await _channelSocketService.CreateChannelAsync(createChannelRequest);

            return(Ok(channel));
        }
Beispiel #2
0
 public async Task <ChannelSummaryResponse> CreateChannelAsync(CreateChannelRequest request)
 {
     return(await ValidateAndExecuteAsync(request, new CreateChannelRequestValidator(), new TaskReference <ChannelSummaryResponse>(async() =>
     {
         var createChannelRequest = new DomainRequest.Channel.CreateChannelRequest(Context.GetSaasUserId(), request.Name, request.Type)
         {
             AllowedMembers = request.AllowedMembers,
             Description = request.Description,
             PhotoUrl = request.PhotoUrl,
             WelcomeMessage = request.WelcomeMessage
         };
         return await _channelSocketService.CreateChannelAsync(createChannelRequest);
     }),
                                          request.RequestId));
 }