Beispiel #1
0
        public async Task <IActionResult> UpdateTicket([FromBody] TicketUpdateViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    await ticketsApi.UpdateTicket(model);

                    return(Json(new { success = true, msg = "Data updated sucessfully!" }));
                }
                catch (Exception ex)
                {
                    return(Json(new { success = false, msg = "an error occured while updating records!" }));
                }
            }
            return(Json(new { success = false, msg = "Fill in all required fields" }));
        }
Beispiel #2
0
        public void UpdateTicket(Tickets ticket)
        {
            TicketsApi ticketApi = new TicketsApi();

            ticketApi.UpdateTicket(ticket);
        }