From b195ad7bff9afb1745a6265374aff19c610a5984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Wed, 23 Dec 2020 20:31:15 +0100 Subject: [PATCH] Use jwennAwtisKantite & jwennTeksKantite in index --- pages/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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: {