mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-10-31 18:57:59 +00:00
Refetch profiles when going back to router
This commit is contained in:
@@ -39,7 +39,7 @@ const AddProfile = () => {
|
|||||||
const [createProfile] = useMutation(CREATE_PROFILE);
|
const [createProfile] = useMutation(CREATE_PROFILE);
|
||||||
|
|
||||||
const handleAddProfile = (profileType, name, details, childProfileIds = []) => {
|
const handleAddProfile = (profileType, name, details, childProfileIds = []) => {
|
||||||
createProfile({
|
return createProfile({
|
||||||
variables: {
|
variables: {
|
||||||
profileType,
|
profileType,
|
||||||
customerId,
|
customerId,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useContext } from 'react';
|
import React, { useContext, useEffect } from 'react';
|
||||||
import gql from 'graphql-tag';
|
import gql from 'graphql-tag';
|
||||||
import { useQuery, useMutation } from '@apollo/react-hooks';
|
import { useQuery, useMutation } from '@apollo/react-hooks';
|
||||||
|
import { useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
import { Alert, notification } from 'antd';
|
import { Alert, notification } from 'antd';
|
||||||
|
|
||||||
@@ -39,6 +40,11 @@ const Profiles = () => {
|
|||||||
variables: { customerId, limit: 100 },
|
variables: { customerId, limit: 100 },
|
||||||
});
|
});
|
||||||
const [deleteProfile] = useMutation(DELETE_PROFILE);
|
const [deleteProfile] = useMutation(DELETE_PROFILE);
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
refetch();
|
||||||
|
}, [location.pathname === '/profiles']);
|
||||||
|
|
||||||
const reloadTable = () => {
|
const reloadTable = () => {
|
||||||
refetch()
|
refetch()
|
||||||
|
|||||||
Reference in New Issue
Block a user