review code pattern consistency
This commit is contained in:
@@ -4,11 +4,11 @@ require '../../../assets/utils/db_auth.php';
|
||||
require '../../../assets/utils/classes_ac/DepartmentManager.php';
|
||||
|
||||
$id = (int)($data['id'] ?? 0);
|
||||
if (!$id) exit(json_encode(['message' => 'Missing id']));
|
||||
if (!$id) { $answer['message'] = 'Missing id'; exit(json_encode($answer)); }
|
||||
|
||||
$dept = new DepartmentManager($pdo2, $company_id);
|
||||
$row = $dept->getById($id);
|
||||
if (!$row) exit(json_encode(['message' => 'Department not found']));
|
||||
if (!$row) { $answer['message'] = 'Department not found'; exit(json_encode($answer)); }
|
||||
|
||||
$answer['output'] = $row;
|
||||
$answer['success'] = 1;
|
||||
|
||||
Reference in New Issue
Block a user