Use jwennAwtisKantite & jwennTeksKantite in index
This commit is contained in:
+5
-5
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user