[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
@@ -238,7 +238,7 @@ class WhistleblowingController extends BaseController
|
||||
}
|
||||
|
||||
if (!empty($updates)) {
|
||||
Database::execute(
|
||||
Database::query(
|
||||
'UPDATE whistleblowing_reports SET ' .
|
||||
implode(', ', array_map(fn($k) => "{$k} = ?", array_keys($updates))) .
|
||||
', updated_at = NOW() WHERE id = ?',
|
||||
@@ -265,7 +265,7 @@ class WhistleblowingController extends BaseController
|
||||
if (!$report) { $this->jsonError('Segnalazione non trovata', 404, 'NOT_FOUND'); }
|
||||
|
||||
$userId = (int)$this->getParam('user_id');
|
||||
Database::execute(
|
||||
Database::query(
|
||||
'UPDATE whistleblowing_reports SET assigned_to = ?, updated_at = NOW() WHERE id = ?',
|
||||
[$userId, $id]
|
||||
);
|
||||
@@ -295,7 +295,7 @@ class WhistleblowingController extends BaseController
|
||||
if (!$report) { $this->jsonError('Segnalazione non trovata', 404, 'NOT_FOUND'); }
|
||||
|
||||
$resolution = trim($this->getParam('resolution_notes', ''));
|
||||
Database::execute(
|
||||
Database::query(
|
||||
'UPDATE whistleblowing_reports SET status = "closed", closed_at = NOW(),
|
||||
closed_by = ?, resolution_notes = ?, updated_at = NOW() WHERE id = ?',
|
||||
[$this->getCurrentUserId(), $resolution, $id]
|
||||
|
||||
Reference in New Issue
Block a user