Skip to content

Commit

Permalink
Changes in tickets assign to agent trashed ticket not assign: uvdesk#38
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhi12-gupta committed Jun 15, 2023
1 parent 047e0e7 commit f69863c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions API/Tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,13 @@ public function assignAgent(Request $request, ContainerInterface $container)

if ($agent) {
if($ticket->getAgent() != $agent) {

if ($ticket->getIsTrashed()) {
$json['status'] = false;
$json['error'] = $container->get('translator')->trans('Tickets is in trashed can not assign to agent.');
return new JsonResponse($json, Response::HTTP_BAD_REQUEST);
}

$ticket->setAgent($agent);
$entityManager->persist($ticket);
$entityManager->flush();
Expand Down

0 comments on commit f69863c

Please sign in to comment.