feat: new user badges, ui consistency pass (#6262)

* feat: new user badges, ui consistency pass

* prepr

* fix: align with backend

* fix: lint

---------

Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
This commit is contained in:
Prospector
2026-05-31 08:25:31 -07:00
committed by GitHub
parent cc8d556448
commit 34b87991bc
47 changed files with 947 additions and 142 deletions
+5 -3
View File
@@ -2,19 +2,21 @@ import { useAppQueryClient } from '~/composables/query-client'
import { useServerModrinthClient } from '~/server/utils/api-client'
export default defineNuxtRouteMiddleware(async (to) => {
if (!to.path.startsWith('/user/') || !to.params.id) {
const userParam = to.params.user ?? to.params.id
const userId = Array.isArray(userParam) ? userParam[0] : userParam
if (!to.path.startsWith('/user/') || !userId) {
return
}
const queryClient = useAppQueryClient()
const authToken = useCookie('auth-token')
const client = useServerModrinthClient({ authToken: authToken.value || undefined })
const userId = to.params.id as string
try {
const user = await queryClient.fetchQuery({
queryKey: ['user', userId],
queryFn: () => client.labrinth.users_v2.get(userId),
queryFn: () => client.labrinth.users_v3.get(userId),
})
if (!user) return