Merge branch 'develop' of github.com:snipe/snipe-it into develop

This commit is contained in:
snipe 2017-05-16 12:32:05 -07:00
commit 708385e23a
2 changed files with 8 additions and 1 deletions

View file

@ -21,7 +21,7 @@ class LocationsController extends Controller
{
$this->authorize('view', Location::class);
$allowed_columns = ['id','name','address','address2','city','state','country','zip','created_at',
'updated_at'];
'updated_at','parent_id'];
$locations = Location::select([
'locations.id',

View file

@ -27,6 +27,11 @@ class LocationsTransformer
$assets_arr = ['id' => $asset->id];
}
$children_arr = [];
foreach($location->childLocations() as $child) {
$children_arr = ['id' => $child->id];
}
$array = [
'id' => e($location->id),
'name' => e($location->name),
@ -39,6 +44,8 @@ class LocationsTransformer
'assets' => $assets_arr,
'created_at' => Helper::getFormattedDateObject($location->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($location->updated_at, 'datetime'),
'parent_id' => e($location->parent_id),
'children' => $children_arr,
];
$permissions_array['available_actions'] = [