diff --git a/pages/index.js b/pages/index.js index e76cff9..8b35d5d 100644 --- a/pages/index.js +++ b/pages/index.js @@ -2,12 +2,12 @@ import {useState} from 'react' import PropTypes from 'prop-types' import Image from 'next/image' import {Button, Container, Grid, Typography, useMediaQuery, Link} from '@material-ui/core' -import axios from 'axios' import TouchAppIcon from '@material-ui/icons/TouchApp' import KatKayLa from '../components/kat-kay-la' import HeadLayout from '../components/head-layout' import Carousel from '../components/carousel' +import {jwennTeksKantite, jwennAwtisKantite} from '../lib/oki-api' export default function Home({kantiteAwtis, kantiteTeks}) { const [handleOpen, setHandleOpen] = useState(false) @@ -76,10 +76,10 @@ Home.propTypes = { } export async function getServerSideProps() { - const awtisResponse = await axios.get(`${process.env.API_URL}/awtis/count`) - const teksResponse = await axios.get(`${process.env.API_URL}/teks/count`) - const kantiteAwtis = awtisResponse.data - const kantiteTeks = teksResponse.data + const awtisResponse = await jwennAwtisKantite() + const teksResponse = await jwennTeksKantite() + const kantiteAwtis = awtisResponse + const kantiteTeks = teksResponse return { props: {