mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
Prettier, yarn update
This commit is contained in:
parent
f001036830
commit
addde38553
2 changed files with 32 additions and 21 deletions
|
@ -13,9 +13,11 @@ import { GetServerSideProps } from "next";
|
|||
import { useRouter } from "next/router";
|
||||
|
||||
export default function ({ spotify }: any) {
|
||||
const { asPath, replace } = useRouter()
|
||||
const { asPath, replace } = useRouter();
|
||||
|
||||
useEffect(() => { replace(asPath) }, [spotify])
|
||||
useEffect(() => {
|
||||
replace(asPath);
|
||||
}, [spotify]);
|
||||
|
||||
return (
|
||||
<FadeIn>
|
||||
|
@ -80,12 +82,12 @@ export default function ({ spotify }: any) {
|
|||
}
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async () => {
|
||||
const { HOST } = process.env
|
||||
const { HOST } = process.env;
|
||||
|
||||
const res = await fetch(`${HOST}/api/spotify`)
|
||||
const data = await res.json()
|
||||
const res = await fetch(`${HOST}/api/spotify`);
|
||||
const data = await res.json();
|
||||
|
||||
return {
|
||||
props: { spotify: data }
|
||||
}
|
||||
}
|
||||
props: { spotify: data },
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue