From 1c2a473c5aeb2a8de8f2db1999dc947ff07cebaa Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Tue, 19 Aug 2025 15:57:57 +0530 Subject: [PATCH] CHANGE_API --- app/Controllers/ThzController.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index fd2f424f..c725b49a 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -110,14 +110,17 @@ class ThzController extends BaseController ->where('thz_master.thz_id', $thz_id) ->findAll(); - $notes = $this->thzMasterNotesModel->ticketConversationList($thz_id); - $result['notes'] = !empty($notes) ? $notes : []; - + if(!empty($result['master'])){ + $notes = $this->thzMasterNotesModel->ticketConversationList($thz_id); + $result['notes'] = !empty($notes) ? $notes : []; + }else{ + return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets master found']))->setStatusCode(400); + } }else{ return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404); } - return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(400); + return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200); }