fix: error on admin billing (#5603)

This commit is contained in:
Calum H.
2026-03-17 19:40:07 +00:00
committed by GitHub
parent 5b968a1486
commit 900a4df1b7

View File

@@ -372,18 +372,20 @@ const messages = defineMessages({
}, },
}) })
const { data: user } = useQuery({ const { data: user, error: userError } = useQuery({
queryKey: ['user', route.params.id], queryKey: ['user', route.params.id],
queryFn: () => useBaseFetch(`user/${route.params.id}`), queryFn: () => useBaseFetch(`user/${route.params.id}`),
}) })
if (!user.value) { watch(userError, (error) => {
throw createError({ if (error) {
fatal: true, showError({
statusCode: 404, fatal: true,
message: formatMessage(messages.userNotFoundError), statusCode: error.statusCode ?? error.status ?? 404,
}) message: formatMessage(messages.userNotFoundError),
} })
}
})
const { data: subscriptions } = useQuery({ const { data: subscriptions } = useQuery({
queryKey: computed(() => ['billing', 'subscriptions', user.value?.id]), queryKey: computed(() => ['billing', 'subscriptions', user.value?.id]),