mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Support images and multipart requests
This commit is contained in:
parent
8bbbb06c5e
commit
f6766c5f23
|
@ -86,7 +86,7 @@ class AccessoriesController extends Controller
|
||||||
*
|
*
|
||||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
* @since [v4.0]
|
* @since [v4.0]
|
||||||
* @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(ImageUploadRequest $request)
|
||||||
|
@ -179,7 +179,7 @@ class AccessoriesController extends Controller
|
||||||
*
|
*
|
||||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
* @since [v4.0]
|
* @since [v4.0]
|
||||||
* @param App\Http\Requests\ImageUploadRequest $request
|
* @param \App\Http\Requests\ImageUploadRequest $request
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
|
@ -188,6 +188,7 @@ class AccessoriesController extends Controller
|
||||||
$this->authorize('update', Accessory::class);
|
$this->authorize('update', Accessory::class);
|
||||||
$accessory = Accessory::findOrFail($id);
|
$accessory = Accessory::findOrFail($id);
|
||||||
$accessory->fill($request->all());
|
$accessory->fill($request->all());
|
||||||
|
$accessory = $request->handleImages($accessory);
|
||||||
|
|
||||||
if ($accessory->save()) {
|
if ($accessory->save()) {
|
||||||
return response()->json(Helper::formatStandardApiResponse('success', $accessory, trans('admin/accessories/message.update.success')));
|
return response()->json(Helper::formatStandardApiResponse('success', $accessory, trans('admin/accessories/message.update.success')));
|
||||||
|
|
Loading…
Reference in a new issue