fixed update equipment

This commit is contained in:
Sean Macfarlane
2021-01-22 18:56:16 -05:00
parent 7eda2074b2
commit af182c93c6

View File

@@ -85,6 +85,7 @@ const UPDATE_EQUIPMENT = gql`
$profileId: ID! $profileId: ID!
$locationId: ID! $locationId: ID!
$name: String! $name: String!
$baseMacAddress: String
$latitude: String $latitude: String
$longitude: String $longitude: String
$serial: String $serial: String
@@ -99,6 +100,7 @@ const UPDATE_EQUIPMENT = gql`
profileId: $profileId profileId: $profileId
locationId: $locationId locationId: $locationId
name: $name name: $name
baseMacAddress: $baseMacAddress
latitude: $latitude latitude: $latitude
longitude: $longitude longitude: $longitude
serial: $serial serial: $serial
@@ -112,6 +114,7 @@ const UPDATE_EQUIPMENT = gql`
profileId profileId
locationId locationId
name name
baseMacAddress
latitude latitude
longitude longitude
serial serial
@@ -199,20 +202,21 @@ const AccessPointDetails = ({ locations }) => {
metricsRefetch(); metricsRefetch();
}; };
const handleUpdateEquipment = ( const handleUpdateEquipment = ({
equipmentId, id: equipmentId,
equipmentType, equipmentType,
inventoryId, inventoryId,
custId, customerId: custId,
profileId, profileId,
locationId, locationId,
name, name,
baseMacAddress,
latitude, latitude,
longitude, longitude,
serial, serial,
lastModifiedTimestamp, lastModifiedTimestamp,
details formattedData,
) => { }) => {
updateEquipment({ updateEquipment({
variables: { variables: {
id: equipmentId, id: equipmentId,
@@ -222,11 +226,12 @@ const AccessPointDetails = ({ locations }) => {
profileId, profileId,
locationId, locationId,
name, name,
baseMacAddress,
latitude, latitude,
longitude, longitude,
serial, serial,
lastModifiedTimestamp, lastModifiedTimestamp,
details, details: formattedData,
}, },
}) })
.then(() => { .then(() => {
@@ -351,7 +356,7 @@ const AccessPointDetails = ({ locations }) => {
return <Loading />; return <Loading />;
} }
if (error) { if (error && !data?.getEquipment) {
return ( return (
<Alert <Alert
message="Error" message="Error"