Use asset model request

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-07-04 21:52:29 +01:00
parent 0f43b3f8f9
commit ef56f599d2
2 changed files with 4 additions and 3 deletions

View file

@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api;
use App\Helpers\Helper; use App\Helpers\Helper;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\StoreAssetModelRequest;
use App\Http\Transformers\AssetModelsTransformer; use App\Http\Transformers\AssetModelsTransformer;
use App\Http\Transformers\AssetsTransformer; use App\Http\Transformers\AssetsTransformer;
use App\Http\Transformers\SelectlistTransformer; use App\Http\Transformers\SelectlistTransformer;
@ -119,7 +120,7 @@ class AssetModelsController extends Controller
* @param \App\Http\Requests\ImageUploadRequest $request * @param \App\Http\Requests\ImageUploadRequest $request
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function store(ImageUploadRequest $request) public function store(StoreAssetModelRequest $request)
{ {
$this->authorize('create', AssetModel::class); $this->authorize('create', AssetModel::class);
$assetmodel = new AssetModel; $assetmodel = new AssetModel;
@ -176,7 +177,7 @@ class AssetModelsController extends Controller
* @param int $id * @param int $id
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function update(ImageUploadRequest $request, $id) public function update(StoreAssetModelRequest $request, $id)
{ {
$this->authorize('update', AssetModel::class); $this->authorize('update', AssetModel::class);
$assetmodel = AssetModel::findOrFail($id); $assetmodel = AssetModel::findOrFail($id);

View file

@ -64,7 +64,7 @@ class AssetModelsController extends Controller
* @since [v1.0] * @since [v1.0]
* @param ImageUploadRequest $request * @param ImageUploadRequest $request
*/ */
public function store(ImageUploadRequest $request) : RedirectResponse public function store(StoreAssetModelRequest $request) : RedirectResponse
{ {
$this->authorize('create', AssetModel::class); $this->authorize('create', AssetModel::class);
$model = new AssetModel; $model = new AssetModel;