[FIX] ServicesController: entity_type (nis2_entity_type col non esiste) + WebhookService risk.status null-safe
This commit is contained in:
parent
086ffbd675
commit
27ec63c28d
@ -71,7 +71,7 @@ class ServicesController extends BaseController
|
|||||||
|
|
||||||
// Cerca in DB
|
// Cerca in DB
|
||||||
$record = Database::fetchOne(
|
$record = Database::fetchOne(
|
||||||
'SELECT ak.*, o.name as org_name, o.nis2_entity_type, o.sector
|
'SELECT ak.*, o.name as org_name, o.entity_type as nis2_entity_type, o.sector
|
||||||
FROM api_keys ak
|
FROM api_keys ak
|
||||||
JOIN organizations o ON o.id = ak.organization_id
|
JOIN organizations o ON o.id = ak.organization_id
|
||||||
WHERE ak.key_hash = ? AND ak.is_active = 1
|
WHERE ak.key_hash = ? AND ak.is_active = 1
|
||||||
@ -888,14 +888,14 @@ class ServicesController extends BaseController
|
|||||||
);
|
);
|
||||||
|
|
||||||
$org = Database::fetchOne(
|
$org = Database::fetchOne(
|
||||||
'SELECT name, nis2_entity_type, sector, employee_count FROM organizations WHERE id = ?',
|
'SELECT name, entity_type, sector, employee_count FROM organizations WHERE id = ?',
|
||||||
[$orgId]
|
[$orgId]
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->jsonSuccess([
|
$this->jsonSuccess([
|
||||||
'organization' => [
|
'organization' => [
|
||||||
'name' => $org['name'],
|
'name' => $org['name'],
|
||||||
'entity_type' => $org['nis2_entity_type'],
|
'entity_type' => $org['entity_type'],
|
||||||
'sector' => $org['sector'],
|
'sector' => $org['sector'],
|
||||||
],
|
],
|
||||||
'overall_score' => $overallScore,
|
'overall_score' => $overallScore,
|
||||||
|
|||||||
@ -264,7 +264,7 @@ class WebhookService
|
|||||||
'impact' => $risk['impact'],
|
'impact' => $risk['impact'],
|
||||||
'risk_level' => $risk['risk_level'],
|
'risk_level' => $risk['risk_level'],
|
||||||
'risk_score' => $risk['inherent_risk_score'],
|
'risk_score' => $risk['inherent_risk_score'],
|
||||||
'status' => $risk['status'],
|
'status' => $risk['status'] ?? 'identified',
|
||||||
'created_at' => $risk['created_at'],
|
'created_at' => $risk['created_at'],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user