From 2f06596d77eb53351b51a09b1c57eeaf4986f3ee Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Tue, 2 Jul 2024 17:32:16 +0800 Subject: [PATCH] urgently patch customer resolving on waypoints, fix is only resolve customer if required attributes filled --- composer.json | 2 +- extension.json | 2 +- package.json | 2 +- server/src/Models/Payload.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index d9fe78e9..13565a52 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "fleetbase/fleetops-api", - "version": "0.5.0", + "version": "0.5.1", "description": "Fleet & Transport Management Extension for Fleetbase", "keywords": [ "fleetbase-extension", diff --git a/extension.json b/extension.json index c69f8477..6e752f90 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "Fleet-Ops", - "version": "0.5.0", + "version": "0.5.1", "description": "Fleet & Transport Management Extension for Fleetbase", "repository": "https://github.com/fleetbase/fleetops", "license": "MIT", diff --git a/package.json b/package.json index b70d4692..d4a3ebdb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fleetbase/fleetops-engine", - "version": "0.5.0", + "version": "0.5.1", "description": "Fleet & Transport Management Extension for Fleetbase", "fleetbase": { "route": "fleet-ops" diff --git a/server/src/Models/Payload.php b/server/src/Models/Payload.php index e2a6a061..aef2aadc 100644 --- a/server/src/Models/Payload.php +++ b/server/src/Models/Payload.php @@ -316,7 +316,7 @@ public function setWaypoints($waypoints = []) } // Handle customer assosciation for waypoint - if (is_array($attributes) && array_key_exists('customer_uuid', $attributes) && array_key_exists('customer_type', $attributes)) { + if (is_array($attributes) && Utils::notEmpty($attributes['customer_uuid']) && Utils::notEmpty($attributes['customer_type'])) { $customerTypeNamespace = Utils::getMutationType($attributes['customer_type']); $customerExists = app($customerTypeNamespace)->where('uuid', $attributes['customer_uuid'])->exists(); if ($customerExists) { @@ -371,7 +371,7 @@ public function insertWaypoints($waypoints = []) } // Handle customer assosciation for waypoint - if (is_array($attributes) && array_key_exists('customer_uuid', $attributes) && array_key_exists('customer_type', $attributes)) { + if (is_array($attributes) && Utils::notEmpty($attributes['customer_uuid']) && Utils::notEmpty($attributes['customer_type'])) { $customerTypeNamespace = Utils::getMutationType($attributes['customer_type']); $customerExists = app($customerTypeNamespace)->where('uuid', $attributes['customer_uuid'])->exists(); if ($customerExists) {