PHP event trigger by NodeJS [stock dashboard]

This commit is contained in:
Thanakorn S
2026-05-25 14:33:36 +07:00
parent 1237888ab9
commit 8027ab569e
15 changed files with 227 additions and 1 deletions
@@ -3,6 +3,7 @@
require_once '../../../assets/utils/db_auth.php';
require_role($user_role, ['owner', 'admin', 'staff']);
require_once '../../../assets/utils/classes/InvoiceManager.php';
require_once '../../../assets/utils/notify_node.php';
$order_id = (int)($data['order_id'] ?? 0);
@@ -22,6 +23,7 @@
$answer['success'] = 1;
$answer['new_id'] = $new_id;
notify_node('invoice_updated', [], $company_id);
} catch (PDOException $e) {
$answer['message'] = 'Database error, please try again.';