mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -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 = [
|
||||
'id','name','address','address2','city','state','country','zip','created_at',
|
||||
'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.id',
|
||||
|
@ -41,7 +41,7 @@ class LocationsController extends Controller
|
|||
'locations.updated_at',
|
||||
'locations.image',
|
||||
'locations.currency'
|
||||
])->withCount('rtd_assets')
|
||||
])->withCount('assignedAssets')
|
||||
->withCount('assets')
|
||||
->withCount('users');
|
||||
|
||||
|
|
|
@ -39,8 +39,8 @@ class LocationsTransformer
|
|||
'state' => e($location->state),
|
||||
'country' => e($location->country),
|
||||
'zip' => e($location->zip),
|
||||
'assets_count' => (int) $location->assets_count,
|
||||
'rtd_assets_count' => (int) $location->rtd_assets_count,
|
||||
'assigned_assets_count' => (int) $location->assigned_assets_count,
|
||||
'assets_count' => (int) $location->assets_count,
|
||||
'users_count' => (int) $location->users_count,
|
||||
|
||||
'created_at' => Helper::getFormattedDateObject($location->created_at, 'datetime'),
|
||||
|
|
Loading…
Reference in a new issue