feat: refactor news and migrate rest of useFetch to $dropFetch

This commit is contained in:
DecDuck
2025-03-14 13:12:04 +11:00
parent bd1cb67cd0
commit 1de9ebdfa5
23 changed files with 299 additions and 297 deletions
+1 -3
View File
@@ -176,10 +176,8 @@ const gameId = route.params.id.toString();
const user = useUser();
const headers = useRequestHeaders(["cookie"]);
const game = await $dropFetch<Game & { versions: GameVersion[] }>(
`/api/v1/games/${gameId}`,
{ headers }
`/api/v1/games/${gameId}`
);
// Preview description (first 30 lines)
+9 -9
View File
@@ -35,7 +35,9 @@
{{ game.mShortDescription }}
</p>
<div>
<div class="mt-8 grid grid-cols-1 lg:grid-cols-2 gap-4 w-fit mx-auto">
<div
class="mt-8 grid grid-cols-1 lg:grid-cols-2 gap-4 w-fit mx-auto"
>
<NuxtLink
:href="`/store/${game.id}`"
class="block w-full rounded-md border border-transparent bg-white px-8 py-3 text-base font-medium text-gray-900 hover:bg-gray-100 sm:w-auto duration-200 hover:scale-105"
@@ -95,14 +97,12 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
const headers = useRequestHeaders(["cookie"]);
const recent = await $dropFetch("/api/v1/store/recent", { headers });
const updated = await $dropFetch("/api/v1/store/updated", { headers });
const released = await $dropFetch("/api/v1/store/released", {
headers,
});
const developers = await $dropFetch("/api/v1/store/developers", { headers });
const publishers = await $dropFetch("/api/v1/store/publishers", { headers });
const recent = await $dropFetch("/api/v1/store/recent");
const updated = await $dropFetch("/api/v1/store/updated");
const released = await $dropFetch("/api/v1/store/released");
const developers = await $dropFetch("/api/v1/store/developers");
const publishers = await $dropFetch("/api/v1/store/publishers");
useHead({
title: "Store",