remove actions and data integrity
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
session_start();
|
||||
require '../../../assets/utils/db_auth.php';
|
||||
require '../../../assets/utils/classes/WarehouseManager.php';
|
||||
|
||||
try {
|
||||
|
||||
dbTransaction($pdo2, function($pdo) use ($data, $company_id) {
|
||||
|
||||
$whMgmt = new WarehouseManager($pdo, $company_id);
|
||||
$whMgmt->deleteStockOut(
|
||||
(int)$data['id'],
|
||||
(int)$data['wh']
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
$answer["success"] = 1;
|
||||
|
||||
} catch (PDOException $e) {
|
||||
$answer["success"] = 0;
|
||||
$answer["message"] = "Database error, please try again";
|
||||
http_response_code(500);
|
||||
|
||||
} catch (Exception $e) {
|
||||
$answer["success"] = 0;
|
||||
$answer["message"] = $e->getMessage();
|
||||
http_response_code(400);
|
||||
}
|
||||
|
||||
exit(json_encode($answer));
|
||||
?>
|
||||
Reference in New Issue
Block a user