mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-11-01 11:17:59 +00:00
removed useEffect and used skip (works)
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import React, { useContext, useEffect } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import gql from 'graphql-tag';
|
import gql from 'graphql-tag';
|
||||||
import { useQuery, useMutation, useLazyQuery } from '@apollo/react-hooks';
|
import { useQuery, useMutation } from '@apollo/react-hooks';
|
||||||
import { Alert, notification } from 'antd';
|
import { Alert, notification } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {
|
import {
|
||||||
@@ -154,14 +154,13 @@ const AccessPointDetails = ({ locations }) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const [
|
const { data: dataFirmware, error: errorFirmware, loading: loadingFirmware } = useQuery(
|
||||||
getAllFirmware,
|
GET_ALL_FIRMWARE,
|
||||||
{ data: dataFirmware, error: errorFirmware, loading: loadingFirmware },
|
{
|
||||||
] = useLazyQuery(GET_ALL_FIRMWARE);
|
skip: !data?.getEquipment?.model,
|
||||||
|
variables: { modelId: data?.getEquipment?.model.toLowerCase() },
|
||||||
useEffect(() => {
|
}
|
||||||
getAllFirmware({ variables: { modelId: data?.getEquipment?.model?.toLowerCase() } });
|
);
|
||||||
}, [data]);
|
|
||||||
|
|
||||||
const { data: dataProfiles, error: errorProfiles, loading: loadingProfiles } = useQuery(
|
const { data: dataProfiles, error: errorProfiles, loading: loadingProfiles } = useQuery(
|
||||||
GET_ALL_PROFILES,
|
GET_ALL_PROFILES,
|
||||||
|
|||||||
Reference in New Issue
Block a user