mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Fixes #3825 - allows fillables through location API
This commit is contained in:
parent
9bfd345774
commit
7da4fe4524
|
@ -70,7 +70,7 @@ class LocationsController extends Controller
|
||||||
$location->fill($request->all());
|
$location->fill($request->all());
|
||||||
|
|
||||||
if ($location->save()) {
|
if ($location->save()) {
|
||||||
return response()->json(Helper::formatStandardApiResponse('success', $location, trans('admin/locations/message.create.success')));
|
return response()->json(Helper::formatStandardApiResponse('success', (new LocationsTransformer)->transformLocation($location), trans('admin/locations/message.create.success')));
|
||||||
}
|
}
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', null, $location->getErrors()));
|
return response()->json(Helper::formatStandardApiResponse('error', null, $location->getErrors()));
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ class LocationsController extends Controller
|
||||||
$location->fill($request->all());
|
$location->fill($request->all());
|
||||||
|
|
||||||
if ($location->save()) {
|
if ($location->save()) {
|
||||||
return response()->json(Helper::formatStandardApiResponse('success', $location, trans('admin/locations/message.update.success')));
|
return response()->json(Helper::formatStandardApiResponse('success', (new LocationsTransformer)->transformLocation($location), trans('admin/locations/message.update.success')));
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', null, $location->getErrors()));
|
return response()->json(Helper::formatStandardApiResponse('error', null, $location->getErrors()));
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Location extends SnipeModel
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $fillable = ['name'];
|
protected $fillable = ['name','parent_id','address','address2','city','state', 'country','zip','ldap_ou'];
|
||||||
protected $hidden = ['user_id'];
|
protected $hidden = ['user_id'];
|
||||||
|
|
||||||
public function users()
|
public function users()
|
||||||
|
|
Loading…
Reference in a new issue