fix: refetch issues
This commit is contained in:
@@ -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: '',
|
||||||
|
|||||||
@@ -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,
|
||||||
|
}),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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 },
|
||||||
|
|||||||
Reference in New Issue
Block a user