PHP event trigger by NodeJS [stock dashboard]

This commit is contained in:
Thanakorn S
2026-05-25 14:33:36 +07:00
parent ba96de50a1
commit 9b41c0a73a
15 changed files with 227 additions and 1 deletions
+2
View File
@@ -4,6 +4,7 @@
require_role($user_role, ['owner', 'admin', 'staff']);
require_once '../../../assets/utils/classes/UsageGuard.php';
require_once '../../../assets/utils/classes/InvoiceManager.php';
require_once '../../../assets/utils/notify_node.php';
try {
$action = $data['action'] ?? 'update';
@@ -29,6 +30,7 @@
if ($is_new) {
(new UsageGuard($pdo1, $company_id, $packages))->increment();
}
notify_node('invoice_updated', [], $company_id);
} catch (PDOException $e) {
$answer['message'] = 'Database error, please try again.';