mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -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
a43b31400f
commit
d911b776bf
|
@ -22,7 +22,6 @@ class AssetMaintenancesTransformer
|
||||||
{
|
{
|
||||||
$array = [
|
$array = [
|
||||||
'id' => (int) $assetmaintenance->id,
|
'id' => (int) $assetmaintenance->id,
|
||||||
|
|
||||||
'asset' => ($assetmaintenance->asset) ? [
|
'asset' => ($assetmaintenance->asset) ? [
|
||||||
'id' => (int) $assetmaintenance->asset->id,
|
'id' => (int) $assetmaintenance->asset->id,
|
||||||
'name'=> ($assetmaintenance->asset->name) ? e($assetmaintenance->asset->name) : null,
|
'name'=> ($assetmaintenance->asset->name) ? e($assetmaintenance->asset->name) : null,
|
||||||
|
@ -30,7 +29,7 @@ class AssetMaintenancesTransformer
|
||||||
|
|
||||||
] : null,
|
] : null,
|
||||||
'title' => ($assetmaintenance->title) ? e($assetmaintenance->title) : null,
|
'title' => ($assetmaintenance->title) ? e($assetmaintenance->title) : null,
|
||||||
'location' => ($assetmaintenance->asset->location) ? [
|
'location' => (($assetmaintenance->asset) && ($assetmaintenance->asset->location)) ? [
|
||||||
'id' => (int) $assetmaintenance->asset->location->id,
|
'id' => (int) $assetmaintenance->asset->location->id,
|
||||||
'name'=> e($assetmaintenance->asset->location->name),
|
'name'=> e($assetmaintenance->asset->location->name),
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue