From 7e1d5746d46dd9bf33b1971f71f809afcdba4bbe Mon Sep 17 00:00:00 2001 From: web-ppanel Date: Tue, 27 Jan 2026 18:08:34 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(admin):=20refresh=20user=20l?= =?UTF-8?q?ist=20after=20balance=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/src/sections/user/index.tsx | 25 +++++++++++++++---- .../user/user-profile/auth-methods-form.tsx | 2 +- .../user/user-profile/basic-info-form.tsx | 2 +- .../user-profile/notify-settings-form.tsx | 2 +- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/apps/admin/src/sections/user/index.tsx b/apps/admin/src/sections/user/index.tsx index b550f2f..b44d2e1 100644 --- a/apps/admin/src/sections/user/index.tsx +++ b/apps/admin/src/sections/user/index.tsx @@ -68,7 +68,11 @@ export default function User() { action={ref} actions={{ render: (row) => [ - , + ref.current?.refresh()} + userId={row.id} + />, , void; +}) { const { t } = useTranslation("user"); const [open, setOpen] = useState(false); const { data: user, refetch } = useQuery({ @@ -302,6 +312,11 @@ function ProfileSheet({ userId }: { userId: number }) { return data.data as API.User; }, }); + + const refetchAll = async () => { + await refetch(); + onUpdated?.(); + }; return ( @@ -331,13 +346,13 @@ function ProfileSheet({ userId }: { userId: number }) { - + - + - + diff --git a/apps/admin/src/sections/user/user-profile/auth-methods-form.tsx b/apps/admin/src/sections/user/user-profile/auth-methods-form.tsx index 145c379..60738ac 100644 --- a/apps/admin/src/sections/user/user-profile/auth-methods-form.tsx +++ b/apps/admin/src/sections/user/user-profile/auth-methods-form.tsx @@ -21,7 +21,7 @@ export function AuthMethodsForm({ refetch, }: { user: API.User; - refetch: () => void; + refetch: () => void | Promise; }) { const { t } = useTranslation("user"); diff --git a/apps/admin/src/sections/user/user-profile/basic-info-form.tsx b/apps/admin/src/sections/user/user-profile/basic-info-form.tsx index 9e5581f..fab8c38 100644 --- a/apps/admin/src/sections/user/user-profile/basic-info-form.tsx +++ b/apps/admin/src/sections/user/user-profile/basic-info-form.tsx @@ -47,7 +47,7 @@ export function BasicInfoForm({ refetch, }: { user: API.User; - refetch: () => void; + refetch: () => void | Promise; }) { const { t } = useTranslation("user"); diff --git a/apps/admin/src/sections/user/user-profile/notify-settings-form.tsx b/apps/admin/src/sections/user/user-profile/notify-settings-form.tsx index eae7f5b..1c7956c 100644 --- a/apps/admin/src/sections/user/user-profile/notify-settings-form.tsx +++ b/apps/admin/src/sections/user/user-profile/notify-settings-form.tsx @@ -34,7 +34,7 @@ export function NotifySettingsForm({ refetch, }: { user: API.User; - refetch: () => void; + refetch: () => void | Promise; }) { const { t } = useTranslation("user");