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