From e6441179c9db408481ab6bcc1c522fffd5f186ad Mon Sep 17 00:00:00 2001 From: LautaroCesso <59095036+LautaroCesso@users.noreply.github.com> Date: Tue, 19 Jan 2021 17:15:43 -0300 Subject: [PATCH] Fix bug in ticket count in admin panel list users (#967) --- server/controllers/ticket/delete.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/controllers/ticket/delete.php b/server/controllers/ticket/delete.php index e22fc3a6..8ed9cc4c 100644 --- a/server/controllers/ticket/delete.php +++ b/server/controllers/ticket/delete.php @@ -56,7 +56,11 @@ class DeleteController extends Controller { throw new RequestException(ERRORS::NO_PERMISSION); } + $ticketAuthor = User::getUser($ticket->authorToArray()['id']); + $ticketAuthor->tickets--; + $ticket->delete(); + $ticketAuthor->store(); Response::respondSuccess(); }