Merge branch 'fixes/only_present_image_url_if_image_present_in_profile_api' into develop
This commit is contained in:
commit
5293cb30bd
1 changed files with 14 additions and 9 deletions
|
@ -27,15 +27,20 @@ class ProfileController extends Controller
|
||||||
|
|
||||||
|
|
||||||
foreach ($checkoutRequests as $checkoutRequest) {
|
foreach ($checkoutRequests as $checkoutRequest) {
|
||||||
$results['rows'][] = [
|
|
||||||
'image' => $checkoutRequest->itemRequested()->present()->getImageUrl(),
|
// Make sure the asset and request still exist
|
||||||
'name' => $checkoutRequest->itemRequested()->present()->name(),
|
if ($checkoutRequest && $checkoutRequest->itemRequested()) {
|
||||||
'type' => $checkoutRequest->itemType(),
|
$results['rows'][] = [
|
||||||
'qty' => $checkoutRequest->quantity,
|
'image' => $checkoutRequest->itemRequested()->present()->getImageUrl(),
|
||||||
'location' => ($checkoutRequest->location()) ? $checkoutRequest->location()->name : null,
|
'name' => $checkoutRequest->itemRequested()->present()->name(),
|
||||||
'expected_checkin' => Helper::getFormattedDateObject($checkoutRequest->itemRequested()->expected_checkin, 'datetime'),
|
'type' => $checkoutRequest->itemType(),
|
||||||
'request_date' => Helper::getFormattedDateObject($checkoutRequest->created_at, 'datetime'),
|
'qty' => $checkoutRequest->quantity,
|
||||||
];
|
'location' => ($checkoutRequest->location()) ? $checkoutRequest->location()->name : null,
|
||||||
|
'expected_checkin' => Helper::getFormattedDateObject($checkoutRequest->itemRequested()->expected_checkin, 'datetime'),
|
||||||
|
'request_date' => Helper::getFormattedDateObject($checkoutRequest->created_at, 'datetime'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue