From 7a543fa6d505ede32f602113c8c3ec3eb533ffc1 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 28 Oct 2017 01:49:13 -0700 Subject: [PATCH] Use new location method on asset API --- app/Http/Transformers/AssetsTransformer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Transformers/AssetsTransformer.php b/app/Http/Transformers/AssetsTransformer.php index 92ba702a15..304d336afc 100644 --- a/app/Http/Transformers/AssetsTransformer.php +++ b/app/Http/Transformers/AssetsTransformer.php @@ -54,9 +54,9 @@ class AssetsTransformer 'id' => (int) $asset->company->id, 'name'=> e($asset->company->name) ] : null, - 'location' => ($asset->assetLoc) ? [ - 'id' => (int) $asset->assetLoc->id, - 'name'=> e($asset->assetLoc->name) + 'location' => ($asset->location) ? [ + 'id' => (int) $asset->location->id, + 'name'=> e($asset->location->name) ] : null, 'rtd_location' => ($asset->defaultLoc) ? [ 'id' => (int) $asset->defaultLoc->id,