Beispiel #1
0
        public async Task <CreateTrelloCard> CreateNewCard(TrelloCardDto trelloCardDto)
        {
            HttpResponseMessage response = await httpClient.PostAsync(CreateUrlPOST(trelloCardDto), null);

            var content = response.Content.ReadAsAsync <CreateTrelloCard>();

            return(content.Result);
        }
Beispiel #2
0
        public Task <CreateTrelloCard> CreateTrelloCard(TrelloCardDto trelloCardDto)
        {
            Task <CreateTrelloCard> newCard = trelloClient.CreateNewCard(trelloCardDto);

            if (newCard != null)
            {
                emailService.SendEmailAsync("*****@*****.**", "Created new Card", "It's work!");
            }
            return(newCard);
        }
Beispiel #3
0
        private Uri CreateUrlPOST(TrelloCardDto trelloCardDto)
        {
            UriBuilder uri = new UriBuilder();

            uri.Scheme = "https";
            uri.Host   = trelloConfig.Endpoint;
            uri.Path   = "cards";
            uri.Query  = "name=" + trelloCardDto.Name + "&desc=" + trelloCardDto.Description + "&pos=" + trelloCardDto.Pos + "&idList=" + trelloCardDto.ListId + "&key=" + trelloConfig.Key + "&token=" + trelloConfig.Token;

            return(uri.Uri);
        }
Beispiel #4
0
 public Task <CreateTrelloCard> GetCreateTrelloCard([FromBody] TrelloCardDto trelloCardDto)
 {
     return(trelloService.CreateTrelloCard(trelloCardDto));
 }