mirror of
https://github.com/modrinth/code.git
synced 2026-09-05 06:19:11 +00:00
refactor: remove useBaseFetch for @modrinth/api-client (#5596)
* Reapply "fix: start swapping useBaseFetch usages to api-client"
This reverts commit f4f33db701.
* fix: bugs
* fix: analytics
* fix: lint
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { injectModrinthClient } from '@modrinth/ui'
|
||||
import { useQuery } from '@tanstack/vue-query'
|
||||
|
||||
import ChartDisplay from '~/components/ui/charts/ChartDisplay.vue'
|
||||
@@ -18,11 +19,12 @@ useHead({
|
||||
})
|
||||
|
||||
const auth = await useAuth()
|
||||
const client = injectModrinthClient()
|
||||
const id = auth.value?.user?.id
|
||||
|
||||
const { data: projects } = useQuery({
|
||||
queryKey: computed(() => ['user', id, 'projects']),
|
||||
queryFn: () => useBaseFetch(`user/${id}/projects`),
|
||||
queryFn: () => client.labrinth.users_v2.getProjects(id),
|
||||
enabled: computed(() => !!id),
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user