review code pattern consistency
This commit is contained in:
@@ -24,7 +24,8 @@ $type = $data['type'] ?? '';
|
||||
|
||||
if (!$id || !$warehouse_id || !in_array($type, ['in', 'out', 'transfer'])) {
|
||||
http_response_code(400);
|
||||
exit(json_encode(['success' => 0, 'message' => 'Invalid parameters.']));
|
||||
$answer['message'] = 'Invalid parameters.';
|
||||
exit(json_encode($answer));
|
||||
}
|
||||
|
||||
$stock = new StockManager($pdo2, $company_id);
|
||||
@@ -44,5 +45,6 @@ try {
|
||||
} catch (Exception $e) {
|
||||
$pdo2->rollBack();
|
||||
http_response_code(400);
|
||||
exit(json_encode(['success' => 0, 'message' => $e->getMessage()]));
|
||||
$answer['message'] = $e->getMessage();
|
||||
exit(json_encode($answer));
|
||||
}
|
||||
Reference in New Issue
Block a user