fix: refetch issues

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-10-22 18:24:50 +02:00
parent 1206f94cf3
commit 411021ee04
3 changed files with 6 additions and 5 deletions

View File

@@ -20,13 +20,12 @@ export function WebhookIntegrationForm({
defaultValues?: RouterOutputs['integration']['get']; defaultValues?: RouterOutputs['integration']['get'];
onSuccess: () => void; onSuccess: () => void;
}) { }) {
const { organizationId, projectId } = useAppParams(); const { organizationId } = useAppParams();
const form = useForm<IForm>({ const form = useForm<IForm>({
defaultValues: mergeDeepRight( defaultValues: mergeDeepRight(
{ {
id: defaultValues?.id, id: defaultValues?.id,
organizationId, organizationId,
projectId,
config: { config: {
type: 'webhook' as const, type: 'webhook' as const,
url: '', url: '',

View File

@@ -51,7 +51,11 @@ export function RuleCard({
trpc.notification.deleteRule.mutationOptions({ trpc.notification.deleteRule.mutationOptions({
onSuccess() { onSuccess() {
toast.success('Rule deleted'); toast.success('Rule deleted');
client.refetchQueries(trpc.notification.rules.pathFilter()); client.refetchQueries(
trpc.notification.rules.queryOptions({
projectId: rule.projectId,
}),
);
}, },
}), }),
); );

View File

@@ -43,8 +43,6 @@ export function getContext(apiUrl: string) {
queries: { queries: {
staleTime: 1000 * 60 * 5, staleTime: 1000 * 60 * 5,
gcTime: 1000 * 60 * 10, gcTime: 1000 * 60 * 10,
refetchOnWindowFocus: false,
refetchOnMount: false,
refetchOnReconnect: false, refetchOnReconnect: false,
}, },
dehydrate: { serializeData: superjson.serialize }, dehydrate: { serializeData: superjson.serialize },