PHP event trigger by NodeJS [stock dashboard]
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
require_once '../../../assets/utils/classes/WarehouseManager.php';
|
||||
require_once '../../../assets/utils/classes/InvoiceManager.php';
|
||||
require_once '../../../assets/utils/classes/CompanySettingManager.php';
|
||||
require_once '../../../assets/utils/notify_node.php';
|
||||
|
||||
$id = (int)($data['id'] ?? 0);
|
||||
|
||||
@@ -35,6 +36,10 @@
|
||||
$answer['message'] = 'Order confirmed.';
|
||||
$answer['auto_approved'] = $auto_approve;
|
||||
$answer['auto_invoice'] = $auto_invoice;
|
||||
notify_node('order_updated', [], $company_id);
|
||||
if ($auto_invoice) {
|
||||
notify_node('invoice_updated', [], $company_id);
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
$answer['message'] = 'Database error, please try again.';
|
||||
|
||||
Reference in New Issue
Block a user