From af182c93c67b0fe49865837528095a2bc0c37e28 Mon Sep 17 00:00:00 2001 From: Sean Macfarlane Date: Fri, 22 Jan 2021 18:56:16 -0500 Subject: [PATCH] fixed update equipment --- .../containers/AccessPointDetails/index.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/containers/Network/containers/AccessPointDetails/index.js b/app/containers/Network/containers/AccessPointDetails/index.js index a42c970..1ee80a7 100644 --- a/app/containers/Network/containers/AccessPointDetails/index.js +++ b/app/containers/Network/containers/AccessPointDetails/index.js @@ -85,6 +85,7 @@ const UPDATE_EQUIPMENT = gql` $profileId: ID! $locationId: ID! $name: String! + $baseMacAddress: String $latitude: String $longitude: String $serial: String @@ -99,6 +100,7 @@ const UPDATE_EQUIPMENT = gql` profileId: $profileId locationId: $locationId name: $name + baseMacAddress: $baseMacAddress latitude: $latitude longitude: $longitude serial: $serial @@ -112,6 +114,7 @@ const UPDATE_EQUIPMENT = gql` profileId locationId name + baseMacAddress latitude longitude serial @@ -199,20 +202,21 @@ const AccessPointDetails = ({ locations }) => { metricsRefetch(); }; - const handleUpdateEquipment = ( - equipmentId, + const handleUpdateEquipment = ({ + id: equipmentId, equipmentType, inventoryId, - custId, + customerId: custId, profileId, locationId, name, + baseMacAddress, latitude, longitude, serial, lastModifiedTimestamp, - details - ) => { + formattedData, + }) => { updateEquipment({ variables: { id: equipmentId, @@ -222,11 +226,12 @@ const AccessPointDetails = ({ locations }) => { profileId, locationId, name, + baseMacAddress, latitude, longitude, serial, lastModifiedTimestamp, - details, + details: formattedData, }, }) .then(() => { @@ -351,7 +356,7 @@ const AccessPointDetails = ({ locations }) => { return ; } - if (error) { + if (error && !data?.getEquipment) { return (