Add ability to modify external id for a server

This commit is contained in:
Dane Everitt 2018-02-25 14:45:16 -06:00
parent 6a4b5e04e2
commit 8daf97021a
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 6 additions and 1 deletions

View File

@ -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.

View File

@ -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'),