Merge pull request #14421 from marcusmoore/fixes/add-minimal-validation-around-asset-tags

Adds a minimal amount of validation around asset_tags in AssetsController
This commit is contained in:
snipe 2024-03-21 00:04:44 +00:00 committed by GitHub
commit 7c39f516b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,6 +102,10 @@ class AssetsController extends Controller
{ {
$this->authorize(Asset::class); $this->authorize(Asset::class);
// There are a lot more rules to add here but prevents
// errors around `asset_tags` not being present below.
$this->validate($request, ['asset_tags' => ['required', 'array']]);
// Handle asset tags - there could be one, or potentially many. // Handle asset tags - there could be one, or potentially many.
// This is only necessary on create, not update, since bulk editing is handled // This is only necessary on create, not update, since bulk editing is handled
// differently // differently