Skip to content

Commit

Permalink
chore: invalidate accounts query after successful account connection
Browse files Browse the repository at this point in the history
  • Loading branch information
raj-k-singh committed Feb 7, 2025
1 parent 9c67725 commit 06b18e8
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import './CloudAccountSetupModal.style.scss';

import { Color } from '@signozhq/design-tokens';
import SignozModal from 'components/SignozModal/SignozModal';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { useIntegrationModal } from 'hooks/integrations/aws/useIntegrationModal';
import { SquareArrowOutUpRight } from 'lucide-react';
import { useCallback } from 'react';
import { useQueryClient } from 'react-query';

import {
ActiveViewEnum,
Expand All @@ -18,6 +20,7 @@ import { SuccessView } from './SuccessView';
function CloudAccountSetupModal({
onClose,
}: IntegrationModalProps): JSX.Element {
const queryClient = useQueryClient();
const {
form,
modalState,
Expand Down Expand Up @@ -110,7 +113,10 @@ function CloudAccountSetupModal({
</div>
),
block: true,
onOk: handleClose,
onOk: (): void => {
queryClient.invalidateQueries([REACT_QUERY_KEY.AWS_ACCOUNTS]);
handleClose();
},
cancelButtonProps: { style: { display: 'none' } },
disabled: false,
};
Expand Down Expand Up @@ -151,6 +157,7 @@ function CloudAccountSetupModal({
activeView,
handleClose,
setActiveView,
queryClient,
]);

const modalConfig = getModalConfig();
Expand Down

0 comments on commit 06b18e8

Please # to comment.