mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-13 06:47:46 -08:00
Updated fieldname in Locations transformer and API
This commit is contained in:
parent
279ad6d80a
commit
3a52c19428
|
@ -24,7 +24,7 @@ class LocationsController extends Controller
|
||||||
$allowed_columns = [
|
$allowed_columns = [
|
||||||
'id','name','address','address2','city','state','country','zip','created_at',
|
'id','name','address','address2','city','state','country','zip','created_at',
|
||||||
'updated_at','parent_id', 'manager_id','image',
|
'updated_at','parent_id', 'manager_id','image',
|
||||||
'rtd_assets_count','users_count','assets_count'];
|
'assigned_assets_count','users_count','assets_count'];
|
||||||
|
|
||||||
$locations = Location::with('parent', 'manager', 'childLocations')->select([
|
$locations = Location::with('parent', 'manager', 'childLocations')->select([
|
||||||
'locations.id',
|
'locations.id',
|
||||||
|
@ -41,7 +41,7 @@ class LocationsController extends Controller
|
||||||
'locations.updated_at',
|
'locations.updated_at',
|
||||||
'locations.image',
|
'locations.image',
|
||||||
'locations.currency'
|
'locations.currency'
|
||||||
])->withCount('rtd_assets')
|
])->withCount('assignedAssets')
|
||||||
->withCount('assets')
|
->withCount('assets')
|
||||||
->withCount('users');
|
->withCount('users');
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,8 @@ class LocationsTransformer
|
||||||
'state' => e($location->state),
|
'state' => e($location->state),
|
||||||
'country' => e($location->country),
|
'country' => e($location->country),
|
||||||
'zip' => e($location->zip),
|
'zip' => e($location->zip),
|
||||||
|
'assigned_assets_count' => (int) $location->assigned_assets_count,
|
||||||
'assets_count' => (int) $location->assets_count,
|
'assets_count' => (int) $location->assets_count,
|
||||||
'rtd_assets_count' => (int) $location->rtd_assets_count,
|
|
||||||
'users_count' => (int) $location->users_count,
|
'users_count' => (int) $location->users_count,
|
||||||
|
|
||||||
'created_at' => Helper::getFormattedDateObject($location->created_at, 'datetime'),
|
'created_at' => Helper::getFormattedDateObject($location->created_at, 'datetime'),
|
||||||
|
|
Loading…
Reference in a new issue