From db29b04c39cf35e413c91ac524bad224b03cd7c7 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 7 Feb 2018 22:50:22 -0600 Subject: [PATCH] Fix improper allocation id validation on API --- CHANGELOG.md | 1 + .../Requests/Api/Application/Servers/StoreServerRequest.php | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a43948eb8..900c06e13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines. ### Fixed * `[rc.2]` — Fixes bad API behavior on `/user` routes. * `[rc.2]` — Fixes Admin CP user editing resetting a password on users unintentionally. +* `[rc.2]` — Fixes bug with server creation API endpoint that would fail to validate `allocation.default` correctly. ### Added * Added ability to search the following API endpoints: list users, list servers, and list locations. diff --git a/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php b/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php index 2c95ab52b..6b4473ab3 100644 --- a/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php +++ b/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php @@ -101,7 +101,6 @@ class StoreServerRequest extends ApplicationApiRequest $validator->sometimes('allocation.default', [ 'required', 'integer', 'bail', Rule::exists('allocations', 'id')->where(function ($query) { - $query->where('node_id', $this->input('node_id')); $query->whereNull('server_id'); }), ], function ($input) { @@ -111,7 +110,6 @@ class StoreServerRequest extends ApplicationApiRequest $validator->sometimes('allocation.additional.*', [ 'integer', Rule::exists('allocations', 'id')->where(function ($query) { - $query->where('node_id', $this->input('node_id')); $query->whereNull('server_id'); }), ], function ($input) {