use new api structure
This commit is contained in:
@@ -23,8 +23,8 @@ export default function GameComponent() {
|
|||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
if (data.data) {
|
if (data) {
|
||||||
setGame(data.data as GameObject);
|
setGame(data as GameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import type { ReactNode } from "react";
|
|||||||
|
|
||||||
export default function Layout({ children }: { children: ReactNode }) {
|
export default function Layout({ children }: { children: ReactNode }) {
|
||||||
return (
|
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 className="w-full sm:w-[500px] relative">{children}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default function MusicComponent() {
|
|||||||
const response = await fetch("https://api.alexav.gg/v4/social/music");
|
const response = await fetch("https://api.alexav.gg/v4/social/music");
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
setMusic(data.data as LastFMMusicObject);
|
setMusic(data as LastFMMusicObject);
|
||||||
} else setFailedFetch(true);
|
} else setFailedFetch(true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Failed to fetch music!", e);
|
console.error("Failed to fetch music!", e);
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ export default function TVComponent() {
|
|||||||
);
|
);
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
if (data.data && data.data.length <= 0) {
|
if (data && data.length <= 0) {
|
||||||
setFailedFetch(true);
|
setFailedFetch(true);
|
||||||
} else setShow(data.data[0] as TVObject);
|
} else setShow(data[0] as TVObject);
|
||||||
} else setFailedFetch(true);
|
} else setFailedFetch(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user