[FIX] Database::execute() → Database::query() in 5 controller
Database non ha metodo execute() — corretto in: InviteController, ServicesController, WebhookController, NormativeController, WhistleblowingController. Causa del HTTP 500 su tutti gli endpoint /api/invites/*. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
c906a6eff3
commit
9ccf2a72b5
@@ -146,7 +146,7 @@ class WebhookController extends BaseController
|
||||
$this->jsonError('API Key non trovata', 404, 'NOT_FOUND');
|
||||
}
|
||||
|
||||
Database::execute(
|
||||
Database::query(
|
||||
'UPDATE api_keys SET is_active = 0, updated_at = NOW() WHERE id = ?',
|
||||
[$id]
|
||||
);
|
||||
@@ -273,7 +273,7 @@ class WebhookController extends BaseController
|
||||
if (!empty($updates)) {
|
||||
$updates['updated_at'] = date('Y-m-d H:i:s');
|
||||
$setClauses = implode(', ', array_map(fn($k) => "{$k} = ?", array_keys($updates)));
|
||||
Database::execute(
|
||||
Database::query(
|
||||
"UPDATE webhook_subscriptions SET {$setClauses} WHERE id = ?",
|
||||
array_merge(array_values($updates), [$id])
|
||||
);
|
||||
@@ -297,7 +297,7 @@ class WebhookController extends BaseController
|
||||
$this->jsonError('Webhook non trovato', 404, 'NOT_FOUND');
|
||||
}
|
||||
|
||||
Database::execute('DELETE FROM webhook_subscriptions WHERE id = ?', [$id]);
|
||||
Database::query('DELETE FROM webhook_subscriptions WHERE id = ?', [$id]);
|
||||
$this->logAudit('webhook_deleted', 'webhook_subscription', $id, ['name' => $sub['name']]);
|
||||
$this->jsonSuccess(null, 'Webhook eliminato');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user