public async Task <IActionResult> UpdateTicket([FromBody] TicketUpdateViewModel ticketUpdate)
        {
            if (!(await _authService.AuthorizeProjectRoleByTicket(eProjectRoles.Reporter, ticketUpdate.Id)))
            {
                return(RedirectToAction("AccessDenied", "Account"));
            }

            _ticketService.UpdateTicket(ticketUpdate.Id, ticketUpdate.State, ticketUpdate.Type, ticketUpdate.AssignedTo);
            return(new AcceptedResult());
        }
        public async Task UpdateTicket(TicketUpdateViewModel model)
        {
            // add a note and or reassign staff
            using (HttpClient client = new HttpClient())
            {
                client.BaseAddress = new Uri(baseUrl);

                HttpResponseMessage msg = await client.GetAsync($"tickets/update/{model.Id}/{model.AssignedStaffId}/{model.Note}");

                msg.EnsureSuccessStatusCode();
                return;
            }
        }
示例#3
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" }));
        }