Updated fieldname in Locations transformer and API

This commit is contained in:
snipe 2017-11-03 19:40:40 -07:00
parent 279ad6d80a
commit 3a52c19428
2 changed files with 4 additions and 4 deletions

View file

@ -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');

View file

@ -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'),