use new api structure

This commit is contained in:
2025-11-07 01:25:22 -05:00
parent 2932b164a6
commit 7c53bc9d43
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -23,8 +23,8 @@ export default function GameComponent() {
if (response.ok) {
const data = await response.json();
if (data.data) {
setGame(data.data as GameObject);
if (data) {
setGame(data as GameObject);
}
}
}
+1 -1
View File
@@ -2,7 +2,7 @@ import type { ReactNode } from "react";
export default function Layout({ children }: { children: ReactNode }) {
return (
<div className="bg-black text-white min-h-screen flex flex-col items-center mx-auto select-none">
<div className="bg-black text-white min-h-screen flex flex-col items-center sm:justify-center mx-auto select-none">
<div className="w-full sm:w-[500px] relative">{children}</div>
</div>
);
+1 -1
View File
@@ -12,7 +12,7 @@ export default function MusicComponent() {
const response = await fetch("https://api.alexav.gg/v4/social/music");
if (response.ok) {
const data = await response.json();
setMusic(data.data as LastFMMusicObject);
setMusic(data as LastFMMusicObject);
} else setFailedFetch(true);
} catch (e) {
console.error("Failed to fetch music!", e);
+2 -2
View File
@@ -27,9 +27,9 @@ export default function TVComponent() {
);
if (response.ok) {
const data = await response.json();
if (data.data && data.data.length <= 0) {
if (data && data.length <= 0) {
setFailedFetch(true);
} else setShow(data.data[0] as TVObject);
} else setShow(data[0] as TVObject);
} else setFailedFetch(true);
}