fix: use domain_name field from Mailcow API response

Mailcow's GET /api/v1/get/domain/all returns domain_name (not domain)
in each response object. Using the wrong key caused the dropdown to
display 'null' for every entry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 08:14:00 +01:00
parent 2ee81efacf
commit 6f7c66e2c4

View File

@@ -371,7 +371,7 @@ class WooCow_Admin {
if ( ! $result['success'] ) { if ( ! $result['success'] ) {
$this->json_err( $result['error'] ?? 'Failed to fetch domains.' ); $this->json_err( $result['error'] ?? 'Failed to fetch domains.' );
} }
$domains = array_map( fn( $d ) => [ 'domain' => $d['domain'], 'active' => $d['active'] ], (array) $result['data'] ); $domains = array_map( fn( $d ) => [ 'domain' => $d['domain_name'], 'active' => $d['active'] ], (array) $result['data'] );
$this->json_ok( $domains ); $this->json_ok( $domains );
} }