New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(pci-private-network): add the delete modal/action for global reg… #11632
Conversation
fa38b60
to
557eef3
Compare
import { TGateway, TRegion } from '@/api/data/project'; | ||
import { getSubnets, TSubnet } from '@/api/data/subnets'; | ||
import { | ||
getLocalZoneRegions, | ||
isLocalZoneRegion, | ||
paginateResults, | ||
} from '@/api/utils/utils'; | ||
import queryClient from '@/queryClient'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't import queryClient, use the useQueryClient
hook
You will create a new instance, not use the one in the context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is imported from a file defining one instance client
import { QueryClient } from '@tanstack/react-query';
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 300_000,
},
},
});
export default queryClient;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok but it still does not look like a good practice to import queryClient directly, even if it works
Using the queryClient from the context is safer imo
https://tanstack.com/query/latest/docs/framework/react/reference/useQueryClient#usequeryclient
Do you think there is any drawbacks to using useQueryClient
hook to take it from the context ?
packages/manager/apps/pci-private-network/src/api/hooks/useNetwork.ts
Outdated
Show resolved
Hide resolved
packages/manager/apps/pci-private-network/src/components/delete/DeleteModal.component.tsx
Outdated
Show resolved
Hide resolved
…ions and local zones ref: DTCORE-2078 ref: DTCORE-2080 Signed-off-by: LIDRISSI Hamid <abdelghani-lidrissi.hamid.ext@ovhcloud.com>
557eef3
to
f30e5a1
Compare
Quality Gate passedIssues Measures |
Description
Related