mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-10-30 18:27:58 +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 handleAddProfile = (profileType, name, details, childProfileIds = []) => {
|
||||
createProfile({
|
||||
return createProfile({
|
||||
variables: {
|
||||
profileType,
|
||||
customerId,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { useContext } from 'react';
|
||||
import React, { useContext, useEffect } from 'react';
|
||||
import gql from 'graphql-tag';
|
||||
import { useQuery, useMutation } from '@apollo/react-hooks';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { Alert, notification } from 'antd';
|
||||
|
||||
@@ -39,6 +40,11 @@ const Profiles = () => {
|
||||
variables: { customerId, limit: 100 },
|
||||
});
|
||||
const [deleteProfile] = useMutation(DELETE_PROFILE);
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
refetch();
|
||||
}, [location.pathname === '/profiles']);
|
||||
|
||||
const reloadTable = () => {
|
||||
refetch()
|
||||
|
||||
Reference in New Issue
Block a user