public async Task <IActionResult> Post([FromBody] SupportTicketModel supportTicketModel)
        {
            long ticketId = 0; // initiate to 0

            if (ModelState.IsValid)
            {
                // Add date ticket raised before write to DB
                ticketId = _ticketServices.CreateTicket(supportTicketModel);
            }

            //return View(supportTicketModel);
            return(Ok(ticketId));
        }
Beispiel #2
0
        public IActionResult CreateClient(Ticket ticket)
        {
            var newTicket = _ticketServices.CreateTicket(ticket);

            return(CreatedAtRoute("GetTicket", new { newTicket.Id }, newTicket));
        }