Fix improper allocation id validation on API
This commit is contained in:
parent
a9c1946319
commit
db29b04c39
|
@ -7,6 +7,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||||
### Fixed
|
### Fixed
|
||||||
* `[rc.2]` — Fixes bad API behavior on `/user` routes.
|
* `[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 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
|
||||||
* Added ability to search the following API endpoints: list users, list servers, and list locations.
|
* Added ability to search the following API endpoints: list users, list servers, and list locations.
|
||||||
|
|
|
@ -101,7 +101,6 @@ class StoreServerRequest extends ApplicationApiRequest
|
||||||
$validator->sometimes('allocation.default', [
|
$validator->sometimes('allocation.default', [
|
||||||
'required', 'integer', 'bail',
|
'required', 'integer', 'bail',
|
||||||
Rule::exists('allocations', 'id')->where(function ($query) {
|
Rule::exists('allocations', 'id')->where(function ($query) {
|
||||||
$query->where('node_id', $this->input('node_id'));
|
|
||||||
$query->whereNull('server_id');
|
$query->whereNull('server_id');
|
||||||
}),
|
}),
|
||||||
], function ($input) {
|
], function ($input) {
|
||||||
|
@ -111,7 +110,6 @@ class StoreServerRequest extends ApplicationApiRequest
|
||||||
$validator->sometimes('allocation.additional.*', [
|
$validator->sometimes('allocation.additional.*', [
|
||||||
'integer',
|
'integer',
|
||||||
Rule::exists('allocations', 'id')->where(function ($query) {
|
Rule::exists('allocations', 'id')->where(function ($query) {
|
||||||
$query->where('node_id', $this->input('node_id'));
|
|
||||||
$query->whereNull('server_id');
|
$query->whereNull('server_id');
|
||||||
}),
|
}),
|
||||||
], function ($input) {
|
], function ($input) {
|
||||||
|
|
Loading…
Reference in New Issue