mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-24 04:03:34 -08:00
Check for associated maintenance asset
This should probably never happen, but triggers on the demo sometimes because of fluctuating data seeding
This commit is contained in:
parent
238a075c6a
commit
fc8637c81a
|
@ -22,7 +22,6 @@ class AssetMaintenancesTransformer
|
|||
{
|
||||
$array = [
|
||||
'id' => (int) $assetmaintenance->id,
|
||||
|
||||
'asset' => ($assetmaintenance->asset) ? [
|
||||
'id' => (int) $assetmaintenance->asset->id,
|
||||
'name'=> ($assetmaintenance->asset->name) ? e($assetmaintenance->asset->name) : null,
|
||||
|
@ -30,7 +29,7 @@ class AssetMaintenancesTransformer
|
|||
|
||||
] : null,
|
||||
'title' => ($assetmaintenance->title) ? e($assetmaintenance->title) : null,
|
||||
'location' => ($assetmaintenance->asset->location) ? [
|
||||
'location' => (($assetmaintenance->asset) && ($assetmaintenance->asset->location)) ? [
|
||||
'id' => (int) $assetmaintenance->asset->location->id,
|
||||
'name'=> e($assetmaintenance->asset->location->name),
|
||||
|
||||
|
|
Loading…
Reference in a new issue