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

View File

@@ -896,9 +896,17 @@ export const useGetWorkspaceWorkflowIntegrationConfig = ({
return useQuery({
queryKey: workspaceKeys.getWorkspaceWorkflowIntegrationConfig(workspaceId, integration),
queryFn: async () => {
const { data } = await apiRequest.get<ProjectWorkflowIntegrationConfig>(
`/api/v1/workspace/${workspaceId}/workflow-integration-config/${integration}`
);
const { data } = await apiRequest
.get<ProjectWorkflowIntegrationConfig>(
`/api/v1/workspace/${workspaceId}/workflow-integration-config/${integration}`
)
.catch((err) => {
if (err.response.status === 404) {
return { data: null };
}
throw err;
});
return data;
},

View File

@@ -24,7 +24,7 @@ import {
import { UsePopUpState } from "@app/hooks/usePopUp";
type Props = {
microsoftTeamsConfig?: ProjectWorkflowIntegrationConfig;
microsoftTeamsConfig?: ProjectWorkflowIntegrationConfig | null;
isMicrosoftTeamsConfigLoading: boolean;
handlePopUpOpen: (
popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>,

View File

@@ -24,7 +24,7 @@ import {
import { UsePopUpState } from "@app/hooks/usePopUp";
type Props = {
slackConfig?: ProjectWorkflowIntegrationConfig;
slackConfig?: ProjectWorkflowIntegrationConfig | null;
isSlackConfigLoading: boolean;
handlePopUpOpen: (
popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>,