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:
@@ -371,7 +371,7 @@ class WooCow_Admin {
|
||||
if ( ! $result['success'] ) {
|
||||
$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 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user