filter_equipment query refetches after AP is added

This commit is contained in:
Irtiza-h30
2020-08-20 13:12:12 -04:00
parent 1c6f8dfdba
commit ded926c98b

View File

@@ -12,7 +12,12 @@ import ClientDeviceDetails from 'containers/Network/containers/ClientDeviceDetai
import BulkEditAccessPoints from 'containers/Network/containers/BulkEditAccessPoints';
import UserContext from 'contexts/UserContext';
import { GET_ALL_LOCATIONS, GET_LOCATION, GET_ALL_PROFILES } from 'graphql/queries';
import {
GET_ALL_LOCATIONS,
GET_LOCATION,
GET_ALL_PROFILES,
FILTER_EQUIPMENT,
} from 'graphql/queries';
import {
CREATE_LOCATION,
UPDATE_LOCATION,
@@ -37,13 +42,21 @@ const Network = () => {
const [createLocation] = useMutation(CREATE_LOCATION);
const [updateLocation] = useMutation(UPDATE_LOCATION);
const [deleteLocation] = useMutation(DELETE_LOCATION);
const [createEquipment] = useMutation(CREATE_EQUIPMENT);
const [checkedLocations, setCheckedLocations] = useState([]);
const [deleteModal, setDeleteModal] = useState(false);
const [editModal, setEditModal] = useState(false);
const [addModal, setAddModal] = useState(false);
const [apModal, setApModal] = useState(false);
const [createEquipment] = useMutation(CREATE_EQUIPMENT, {
refetchQueries: [
{
query: FILTER_EQUIPMENT,
variables: { customerId, locationIds: checkedLocations, equipmentType: 'AP' },
},
],
});
const handleGetSingleLocation = id => {
getLocation({
variables: { id },