Skip to content

Commit

Permalink
Merge pull request #123 from fleetbase/dev-v0.5.7
Browse files Browse the repository at this point in the history
v0.5.7 - fixes for loading relations on resources
  • Loading branch information
roncodes authored Aug 31, 2024
2 parents e834be3 + 59ec5a9 commit 7acaa93
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 22 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleetbase/fleetops-api",
"version": "0.5.6",
"version": "0.5.7",
"description": "Fleet & Transport Management Extension for Fleetbase",
"keywords": [
"fleetbase-extension",
Expand All @@ -22,7 +22,7 @@
],
"require": {
"php": "^8.0",
"fleetbase/core-api": "^1.5.3",
"fleetbase/core-api": "^1.5.5",
"barryvdh/laravel-dompdf": "^2.0",
"brick/geo": "0.7.2",
"cknow/laravel-money": "^7.1",
Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Fleet-Ops",
"version": "0.5.6",
"version": "0.5.7",
"description": "Fleet & Transport Management Extension for Fleetbase",
"repository": "https://github.com/fleetbase/fleetops",
"license": "AGPL-3.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/fleetops-engine",
"version": "0.5.6",
"version": "0.5.7",
"description": "Fleet & Transport Management Extension for Fleetbase",
"fleetbase": {
"route": "fleet-ops"
Expand Down
11 changes: 2 additions & 9 deletions server/src/Http/Resources/v1/PurchaseRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Fleetbase\FleetOps\Http\Resources\v1;

use Fleetbase\FleetOps\Support\Utils;
use Fleetbase\Http\Resources\FleetbaseResource;
use Fleetbase\Support\Http;

Expand Down Expand Up @@ -62,14 +61,8 @@ public function toWebhookPayload()
*/
public function serviceQuote()
{
if (Utils::notEmpty($this->service_quote_uuid) && Utils::isEmpty($this->serviceQuote)) {
$this->load(['serviceArea']);
}
$this->loadMissing('serviceQuote');

if (Utils::isEmpty($this->serviceQuote)) {
return null;
}

return new ServiceQuote($this->serviceQuote);
return $this->serviceQuote ? new ServiceQuote($this->serviceQuote) : null;
}
}
11 changes: 2 additions & 9 deletions server/src/Http/Resources/v1/TrackingStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Fleetbase\FleetOps\Http\Resources\v1;

use Fleetbase\FleetOps\Support\Utils;
use Fleetbase\Http\Resources\FleetbaseResource;
use Fleetbase\LaravelMysqlSpatial\Types\Point;
use Fleetbase\Support\Http;
Expand Down Expand Up @@ -68,14 +67,8 @@ public function toWebhookPayload()
*/
public function trackingNumber()
{
if (Utils::notEmpty($this->tracking_number_uuid) && Utils::isEmpty($this->trackingNumber)) {
$this->load(['trackingNumber']);
}
$this->loadMissing('trackingNumner');

if (Utils::isEmpty($this->trackingNumber)) {
return null;
}

return new TrackingNumber($this->trackingNumber);
return $this->trackingNumber ? new TrackingNumber($this->trackingNumber) : null;
}
}

0 comments on commit 7acaa93

Please sign in to comment.