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 PropTypes from 'prop-types'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import {Button, Container, Grid, Typography, useMediaQuery, Link} from '@material-ui/core'
|
import {Button, Container, Grid, Typography, useMediaQuery, Link} from '@material-ui/core'
|
||||||
import axios from 'axios'
|
|
||||||
import TouchAppIcon from '@material-ui/icons/TouchApp'
|
import TouchAppIcon from '@material-ui/icons/TouchApp'
|
||||||
|
|
||||||
import KatKayLa from '../components/kat-kay-la'
|
import KatKayLa from '../components/kat-kay-la'
|
||||||
import HeadLayout from '../components/head-layout'
|
import HeadLayout from '../components/head-layout'
|
||||||
import Carousel from '../components/carousel'
|
import Carousel from '../components/carousel'
|
||||||
|
import {jwennTeksKantite, jwennAwtisKantite} from '../lib/oki-api'
|
||||||
|
|
||||||
export default function Home({kantiteAwtis, kantiteTeks}) {
|
export default function Home({kantiteAwtis, kantiteTeks}) {
|
||||||
const [handleOpen, setHandleOpen] = useState(false)
|
const [handleOpen, setHandleOpen] = useState(false)
|
||||||
@@ -76,10 +76,10 @@ Home.propTypes = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getServerSideProps() {
|
export async function getServerSideProps() {
|
||||||
const awtisResponse = await axios.get(`${process.env.API_URL}/awtis/count`)
|
const awtisResponse = await jwennAwtisKantite()
|
||||||
const teksResponse = await axios.get(`${process.env.API_URL}/teks/count`)
|
const teksResponse = await jwennTeksKantite()
|
||||||
const kantiteAwtis = awtisResponse.data
|
const kantiteAwtis = awtisResponse
|
||||||
const kantiteTeks = teksResponse.data
|
const kantiteTeks = teksResponse
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
Reference in New Issue
Block a user