|
@@ -12,6 +12,7 @@ import Layout from "../components/common/Layout";
|
|
|
import "../styles/globals.scss";
|
|
import "../styles/globals.scss";
|
|
|
import { pageview } from "../libs/gtag";
|
|
import { pageview } from "../libs/gtag";
|
|
|
import { GA_TRACKING_ID } from "../libs/config";
|
|
import { GA_TRACKING_ID } from "../libs/config";
|
|
|
|
|
+import { get } from "../utils/http";
|
|
|
|
|
|
|
|
export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
|
|
export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
|
|
|
getLayout?: (page: ReactElement) => ReactNode;
|
|
getLayout?: (page: ReactElement) => ReactNode;
|
|
@@ -67,7 +68,7 @@ const MyApp = ({ Component, pageProps }: AppPropsWithLayout) => {
|
|
|
MyApp.getInitialProps = async function (context: AppContext) {
|
|
MyApp.getInitialProps = async function (context: AppContext) {
|
|
|
App.getInitialProps(context);
|
|
App.getInitialProps(context);
|
|
|
|
|
|
|
|
- const { data } = await fetch("/api/genre/list").then((res) => res.json());
|
|
|
|
|
|
|
+ const { data } = await get("/api/genre/list");
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
pageProps: { genre: data },
|
|
pageProps: { genre: data },
|