From edbe49d4046419c343ed78f326a31e9c06b0183a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Thu, 11 Sep 2025 13:17:44 +0000 Subject: [PATCH] Fix FLEXIAPI-385 Use domains and not hosts in the EmailServer endpoints as... --- CHANGELOG.md | 2 ++ .../Api/Admin/Space/EmailServerController.php | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 914a66b..aedc1e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ v2.1 - Fix FLEXIAPI-380 Fix CardDav documentation - Fix FLEXIAPI-381 Remove Remi in the Rocky9 pipeline - Fix FLEXIAPI-382 Package for Rocky 10 +- Fix FLEXIAPI-384 Allow carddav_user_credentials to be set and use the correct host -> domain parameter in the endpoints +- Fix FLEXIAPI-385 Use domains and not hosts in the EmailServer endpoints as defined in the API documentation v2.0 ---- diff --git a/flexiapi/app/Http/Controllers/Api/Admin/Space/EmailServerController.php b/flexiapi/app/Http/Controllers/Api/Admin/Space/EmailServerController.php index 5e4298f..5b9dd2e 100644 --- a/flexiapi/app/Http/Controllers/Api/Admin/Space/EmailServerController.php +++ b/flexiapi/app/Http/Controllers/Api/Admin/Space/EmailServerController.php @@ -11,14 +11,14 @@ use Illuminate\Http\Request; class EmailServerController extends Controller { - public function show(string $host) + public function show(string $domain) { - return Space::where('host', $host)->firstOrFail()->emailServer()->firstOrFail(); + return Space::where('domain', $domain)->firstOrFail()->emailServer()->firstOrFail(); } - public function store(CreateUpdate $request, string $host) + public function store(CreateUpdate $request, string $domain) { - $space = Space::where('host', $host)->firstOrFail(); + $space = Space::where('domain', $domain)->firstOrFail(); $emailServer = $space->emailServer ?? new SpaceEmailServer; $emailServer->space_id = $space->id; @@ -35,9 +35,9 @@ class EmailServerController extends Controller return $emailServer; } - public function destroy(string $host) + public function destroy(string $domain) { - $space = Space::where('host', $host)->firstOrFail(); + $space = Space::where('host', $domain)->firstOrFail(); return $space->emailServer->delete(); } }