fix: query invalidation

This commit is contained in:
Daniel Hougaard
2025-05-02 00:41:46 +04:00
parent 240f558231
commit 219964a242
3 changed files with 13 additions and 5 deletions
+11 -3
View File
@@ -896,9 +896,17 @@ export const useGetWorkspaceWorkflowIntegrationConfig = ({
return useQuery({ return useQuery({
queryKey: workspaceKeys.getWorkspaceWorkflowIntegrationConfig(workspaceId, integration), queryKey: workspaceKeys.getWorkspaceWorkflowIntegrationConfig(workspaceId, integration),
queryFn: async () => { queryFn: async () => {
const { data } = await apiRequest.get<ProjectWorkflowIntegrationConfig>( const { data } = await apiRequest
`/api/v1/workspace/${workspaceId}/workflow-integration-config/${integration}` .get<ProjectWorkflowIntegrationConfig>(
); `/api/v1/workspace/${workspaceId}/workflow-integration-config/${integration}`
)
.catch((err) => {
if (err.response.status === 404) {
return { data: null };
}
throw err;
});
return data; return data;
}, },
@@ -24,7 +24,7 @@ import {
import { UsePopUpState } from "@app/hooks/usePopUp"; import { UsePopUpState } from "@app/hooks/usePopUp";
type Props = { type Props = {
microsoftTeamsConfig?: ProjectWorkflowIntegrationConfig; microsoftTeamsConfig?: ProjectWorkflowIntegrationConfig | null;
isMicrosoftTeamsConfigLoading: boolean; isMicrosoftTeamsConfigLoading: boolean;
handlePopUpOpen: ( handlePopUpOpen: (
popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>, popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>,
@@ -24,7 +24,7 @@ import {
import { UsePopUpState } from "@app/hooks/usePopUp"; import { UsePopUpState } from "@app/hooks/usePopUp";
type Props = { type Props = {
slackConfig?: ProjectWorkflowIntegrationConfig; slackConfig?: ProjectWorkflowIntegrationConfig | null;
isSlackConfigLoading: boolean; isSlackConfigLoading: boolean;
handlePopUpOpen: ( handlePopUpOpen: (
popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>, popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>,