mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-12 15:52:39 +10:00
fix(library): Use $dropFetch util
This commit is contained in:
@ -169,12 +169,12 @@ import type { Game } from "@prisma/client";
|
|||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const id = route.params.id.toString();
|
const id = route.params.id.toString();
|
||||||
|
|
||||||
const { data: rawGame } = await useFetch<Game>(`/api/v1/games/${id}`);
|
const rawGame = await $dropFetch<Game>(`/api/v1/games/${id}`);
|
||||||
const game = computed(() => {
|
const game = computed(() => {
|
||||||
if (!rawGame.value) {
|
if (!rawGame) {
|
||||||
throw createError({ statusCode: 404, message: 'Game not found' });
|
throw createError({ statusCode: 404, message: 'Game not found' });
|
||||||
}
|
}
|
||||||
return rawGame.value;
|
return rawGame;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Convert markdown to HTML
|
// Convert markdown to HTML
|
||||||
|
|||||||
Reference in New Issue
Block a user