diff --git a/CHANGELOG.md b/CHANGELOG.md index ece19fa7a..706af0715 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ This project follows [Semantic Versioning](http://semver.org) guidelines. ### Fixed * Fixes server creation API endpoint not passing the provided `external_id` to the creation service. +### Added +* Adds ability to modify the external ID for a server through the API. + ## v0.7.2 (Derelict Dermodactylus) ### Fixed * Fixes an exception thrown when trying to access the `/nests/:id/eggs/:id` API endpoint. diff --git a/app/Http/Requests/Api/Application/Servers/UpdateServerDetailsRequest.php b/app/Http/Requests/Api/Application/Servers/UpdateServerDetailsRequest.php index 4b75138b9..aa585bad6 100644 --- a/app/Http/Requests/Api/Application/Servers/UpdateServerDetailsRequest.php +++ b/app/Http/Requests/Api/Application/Servers/UpdateServerDetailsRequest.php @@ -13,9 +13,10 @@ class UpdateServerDetailsRequest extends ServerWriteRequest */ public function rules(): array { - $rules = Server::getUpdateRulesForId($this->route()->parameter('server')->id); + $rules = Server::getUpdateRulesForId($this->getModel(Server::class)->id); return [ + 'external_id' => $rules['external_id'], 'name' => $rules['name'], 'user' => $rules['owner_id'], 'description' => array_merge(['nullable'], $rules['description']), @@ -31,6 +32,7 @@ class UpdateServerDetailsRequest extends ServerWriteRequest public function validated(): array { return [ + 'external_id' => $this->input('external_id'), 'name' => $this->input('name'), 'owner_id' => $this->input('user'), 'description' => $this->input('description'),