From cba7a46f2a15871fee42ce40899fc9b153122df5 Mon Sep 17 00:00:00 2001 From: Milo Schwartz Date: Sun, 24 Nov 2024 22:52:56 -0500 Subject: [PATCH] fresh resources page on update --- .../[orgId]/settings/resources/[resourceId]/general/page.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/[orgId]/settings/resources/[resourceId]/general/page.tsx b/src/app/[orgId]/settings/resources/[resourceId]/general/page.tsx index dbab044c..bff69fd3 100644 --- a/src/app/[orgId]/settings/resources/[resourceId]/general/page.tsx +++ b/src/app/[orgId]/settings/resources/[resourceId]/general/page.tsx @@ -34,7 +34,7 @@ import { ListSitesResponse } from "@server/routers/site"; import { useEffect, useState } from "react"; import { AxiosResponse } from "axios"; import api from "@app/api"; -import { useParams } from "next/navigation"; +import { useParams, useRouter } from "next/navigation"; import { useForm } from "react-hook-form"; import { GetResourceAuthInfoResponse } from "@server/routers/resource"; import { useToast } from "@app/hooks/useToast"; @@ -57,6 +57,7 @@ export default function GeneralForm() { const { toast } = useToast(); const { resource, updateResource } = useResourceContext(); const { org } = useOrgContext(); + const router = useRouter(); const orgId = params.orgId; @@ -112,6 +113,8 @@ export default function GeneralForm() { }); updateResource({ name: data.name, subdomain: data.subdomain }); + + router.refresh(); }) .finally(() => setSaveLoading(false)); }