diff --git a/api/latest_news/news.js b/api/latest_news/news.js
index 0e6753d..9f3c2a2 100644
--- a/api/latest_news/news.js
+++ b/api/latest_news/news.js
@@ -24,6 +24,30 @@ async function GetNews(token="", start = 0) {
return res;
}
+async function GetOtherNews(token="", start = 0) {
+ var res = await apollo.query(
+ `
+ query($start: Int!) {
+ latestNews(limit:3,start:$start)
+ {
+ id
+ title
+ description
+ img{
+ url
+ }
+ published_at
+ }
+ }
+ `,
+ token,
+ {
+ start: start,
+ }
+ );
+ return res;
+}
+
async function GetDetailNews(id, token="") {
var res = await apollo.query(
`
@@ -51,4 +75,5 @@ async function GetDetailNews(id, token="") {
module.exports = {
GetNews: GetNews,
GetDetailNews: GetDetailNews,
+ GetOtherNews:GetOtherNews,
};
\ No newline at end of file
diff --git a/api/product/apparel.js b/api/product/apparel.js
new file mode 100644
index 0000000..d156fc3
--- /dev/null
+++ b/api/product/apparel.js
@@ -0,0 +1,182 @@
+import apollo from "../../lib/apollo.js";
+
+async function GetApparel(filter, token="") {
+ var res = await apollo.query(
+ `
+ query {
+ apparels(where: { category: "RConcept" ${(filter!="")?`name: "${filter}"`:""}}) {
+ id
+ name
+ price
+ img {
+ url
+ }
+ }
+ }`,
+ token
+ );
+ return res;
+}
+
+async function GetApparel46Asia(filter, token="") {
+ var res = await apollo.query(
+ `
+ query {
+ apparels(where: { category: "Asia" ${(filter!="")?`name: "${filter}"`:""}}) {
+ id
+ name
+ price
+ img {
+ url
+ }
+ }
+ }`,
+ token
+ );
+ return res;
+}
+
+async function GetApparelBasic(filter, token="") {
+ var res = await apollo.query(
+ `
+ query {
+ apparels(where: { category: "Basic" ${(filter!="")?`name: "${filter}"`:""}}) {
+ id
+ name
+ price
+ img {
+ url
+ }
+ }
+ }`,
+ token
+ );
+ return res;
+}
+
+async function GetApparelMerchandise(filter, token="") {
+ var res = await apollo.query(
+ `
+ query {
+ apparels(where: { category: "Merchandise" ${(filter!="")?`name: "${filter}"`:""}}) {
+ id
+ name
+ price
+ img {
+ url
+ }
+ }
+ }`,
+ token
+ );
+ return res;
+}
+
+async function GetApparelMaxi(filter, token="") {
+ var res = await apollo.query(
+ `
+ query {
+ apparels(where: { category: "Maxi" ${(filter!="")?`name: "${filter}"`:""}}) {
+ id
+ name
+ price
+ img {
+ url
+ }
+ }
+ }`,
+ token
+ );
+ return res;
+}
+
+async function GetApparelRainSuit(filter, token="") {
+ var res = await apollo.query(
+ `
+ query {
+ apparels(where: { category: "RainSuit" ${(filter!="")?`name: "${filter}"`:""}}) {
+ id
+ name
+ price
+ img {
+ url
+ }
+ }
+ }`,
+ token
+ );
+ return res;
+}
+
+async function GetApparelMotoGP(filter, token="") {
+ var res = await apollo.query(
+ `
+ query {
+ apparels(where: { category: "motoGP" ${(filter!="")?`name: "${filter}"`:""}}) {
+ id
+ name
+ price
+ img {
+ url
+ }
+ }
+ }`,
+ token
+ );
+ return res;
+}
+
+async function GetApparelOffRoad(filter, token="") {
+ var res = await apollo.query(
+ `
+ query {
+ apparels(where: { category: "OffRoad" ${(filter!="")?`name: "${filter}"`:""}}) {
+ id
+ name
+ price
+ img {
+ url
+ }
+ }
+ }`,
+ token
+ );
+ return res;
+}
+
+async function GetDetailApparel(id, token="") {
+ var res = await apollo.query(
+ `
+ query($input: ID!){
+ apparels(where:{id:$input})
+ {
+ id
+ name
+ description
+ price
+ part_code
+ img {
+ url
+ }
+ stock
+ }
+ } `,
+ token,
+ {
+ "input": id
+ }
+ );
+ return res;
+}
+
+module.exports = {
+ GetApparel:GetApparel,
+ GetApparel46Asia:GetApparel46Asia,
+ GetApparelBasic:GetApparelBasic,
+ GetApparelMerchandise:GetApparelMerchandise,
+ GetApparelMaxi:GetApparelMaxi,
+ GetApparelRainSuit:GetApparelRainSuit,
+ GetApparelMotoGP:GetApparelMotoGP,
+ GetApparelOffRoad:GetApparelOffRoad,
+ GetDetailApparel:GetDetailApparel,
+};
\ No newline at end of file
diff --git a/api/product/part.js b/api/product/part.js
new file mode 100644
index 0000000..e69de29
diff --git a/pages-sections/carrer/carrer_details.js b/pages-sections/carrer/carrer_details.js
index 98afeab..4feb2ab 100644
--- a/pages-sections/carrer/carrer_details.js
+++ b/pages-sections/carrer/carrer_details.js
@@ -1,24 +1,62 @@
import React from 'react';
-import { makeStyles } from "@material-ui/core/styles";
import ReactHtmlParser from "react-html-parser";
+import { makeStyles } from "@material-ui/core/styles";
+import classNames from "classnames";
+import GridContainer from "components/Grid/GridContainer.js";
+import Grid from '@material-ui/core/Grid';
+import GridItem from "components/Grid/GridItem.js";
import Card from "components/Card/Card.js";
-import CardBody from "components/Card/CardBody.js";
-import CardHeader from "components/Card/CardHeader.js";
+import Carousel from "react-slick";
+import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js";
+const useStyles = makeStyles(styles);
const DataCarrer = function ({ backend, detailcarrer, ...props }) {
+ const classes = useStyles();
+ const imageClasses = classNames(
+ classes.imgRaised,
+ classes.imgRoundedCircle,
+ classes.imgFluid
+ );
+ const settings = {
+ dots: true,
+ infinite: true,
+ speed: 500,
+ slidesToShow: 1,
+ slidesToScroll: 1,
+ autoplay: true,
+ time: 5
+ };
+ const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
const carrer = detailcarrer.map((data) => {
return (
-
- {data.name}
-
-
-

-
- Masa Pendaftaran : {data.start_regis} s/d {data.until_regis}
- {ReactHtmlParser(data.description)}
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {data.name}
+ {data.published_at}
+
+
+
{ReactHtmlParser(data.description)}
+
+
+
);
})
return (
diff --git a/pages-sections/dealers/dealers.js b/pages-sections/dealers/dealers.js
index 6a0abc7..2c3f4ef 100644
--- a/pages-sections/dealers/dealers.js
+++ b/pages-sections/dealers/dealers.js
@@ -19,7 +19,7 @@ const DataDealer = function ({ selected, handleName, backend, dealers, ...props
const Dealers = dealers.map((data) => {
return (
-
+
{data.name}
@@ -59,8 +59,7 @@ const DataDealer = function ({ selected, handleName, backend, dealers, ...props
onChange={values => handleName(values)}
/>
-
- {Dealers}
+
{Dealers}
diff --git a/pages-sections/latest_news/news_details.js b/pages-sections/latest_news/news_details.js
index cd751c1..aa2655d 100644
--- a/pages-sections/latest_news/news_details.js
+++ b/pages-sections/latest_news/news_details.js
@@ -1,62 +1,93 @@
import React, { useState, useEffect } from "react";
-import Router, { withRouter } from "next/router";
import ReactHtmlParser from "react-html-parser";
// @material-ui/core components
import { makeStyles } from "@material-ui/core/styles";
import ReactPaginate from "react-paginate";
+import classNames from "classnames";
+import GridContainer from "components/Grid/GridContainer.js";
+import Grid from '@material-ui/core/Grid';
+import GridItem from "components/Grid/GridItem.js";
+import Card from "components/Card/Card.js";
+import Carousel from "react-slick";
+import CardBody from "components/Card/CardBody.js";
+import Button from "components/CustomButtons/Button.js";
+import Icon from "@material-ui/core/Icon";
import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js";
const useStyles = makeStyles(styles);
-const DataLatestNews = function ({ backend, news, ...props }) {
- const [isLoading, setLoading] = useState(false); //State for the loading indicator
- const startLoading = () => setLoading(true);
- const stopLoading = () => setLoading(false);
- useEffect(() => {
- //After the component is mounted set router event handlers
- Router.events.on("routeChangeStart", startLoading);
- Router.events.on("routeChangeComplete", stopLoading);
-
- return () => {
- Router.events.off("routeChangeStart", startLoading);
- Router.events.off("routeChangeComplete", stopLoading);
- };
- }, []);
- const pagginationHandler = (page) => {
- const currentPath = props.router.pathname;
- const currentQuery = props.router.query;
- currentQuery.page = page.selected + 1;
-
- props.router.push({
- pathname: currentPath,
- query: currentQuery,
- });
- };
-
+const DataLatestNews = function ({ backend, news, othernews,...props }) {
const classes = useStyles();
+ const imageClasses = classNames(
+ classes.imgRaised,
+ classes.imgRoundedCircle,
+ classes.imgFluid
+ );
+ const settings = {
+ dots: true,
+ infinite: true,
+ speed: 500,
+ slidesToShow: 1,
+ slidesToScroll: 1,
+ autoplay: true,
+ time: 5
+ };
+ const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
+ const otherlatnews = othernews.map((data) => {
+ return (
+
+
+
+
+ {data.title}
+
+
+
+
+ );
+ })
const latnews = news.map((data) => {
return (
-
-
-
{data.title}
-
-
-
-
-

-
-
- {data.published_at}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Other Latest News
+ {otherlatnews}
+
+
+
+
+
+
+
+
+ {data.title}
+ {data.published_at}
+
+
+
{ReactHtmlParser(data.description)}
-
-
-
{ReactHtmlParser(data.description)}
-
+
+
);
});
return
{latnews}
;
diff --git a/pages-sections/product/apparel.js b/pages-sections/product/apparel.js
index cb4fc0e..53f4383 100644
--- a/pages-sections/product/apparel.js
+++ b/pages-sections/product/apparel.js
@@ -9,10 +9,11 @@ import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/noti
import Card from "components/Card/Card.js";
import CardBody from "components/Card/CardBody.js";
import GridContainer from "components/Grid/GridContainer.js";
+import SnackbarContent from "components/Snackbar/SnackbarContent.js";
const useStyles = makeStyles(styles);
-const DataApparel = function ({ selected, handleName, backend, apparel, ...props }) {
+const DataApparel = function ({ selected, handleName, backend, apparel, asia, basic, merchand, maxi, rainsuit, motogp, offroad, ...props }) {
const classes = useStyles();
const { ...rest } = props;
const imageClasses = classNames(
@@ -21,18 +22,49 @@ const DataApparel = function ({ selected, handleName, backend, apparel, ...props
classes.imgFluid
);
const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
- const ProductApparel = apparel.map((data) => {
- return (
-
+ const ProductApparelRCon = apparel.map((data) => {
+ return (
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
+
+
+ );
+ })
+ const ProductApparelAsia = asia.map((data) => {
+ return (
+
+
+
+
-
{data.name}
- Rp.{data.price}
+ {data.name}
+ Rp.{data.price}
+
+
+
);
})
return (
-
+
-
+
Yamaha Apparel
+
+
+ APPAREL R CONCEPT
+ }
+ align="center"
+ color="danger"
+ />
+
+
+ {ProductApparelRCon}
+
+
+
+
+ APPAREL 46ASIA
+ }
+ align="center"
+ color="danger"
+ />
+
+
+ {ProductApparelAsia}
-
+
diff --git a/pages-sections/product/apparel_details.js b/pages-sections/product/apparel_details.js
index f66d897..ea9c3b0 100644
--- a/pages-sections/product/apparel_details.js
+++ b/pages-sections/product/apparel_details.js
@@ -64,21 +64,10 @@ const DetailDataApparel = function ({ backend, detailapparel, ...props }) {
Stock : {data.stock}
- Part Code : {data.part_code}
+ Part Code : {ReactHtmlParser(data.part_code)}
-
-
-
-
-
-
-
-
-
-
-
Deskripsi
diff --git a/pages-sections/product/helmet.js b/pages-sections/product/helmet.js
index 88b75a8..76e538d 100644
--- a/pages-sections/product/helmet.js
+++ b/pages-sections/product/helmet.js
@@ -25,177 +25,193 @@ const DataHelmet = function ({ selected, handleName, backend, helmet, mtx, extre
const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
const ProductHelmetRConcepts = helmet.map((data) => {
return (
-
-

-
-
{data.name}
-
Rp.{data.price}
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
);
})
const ProductHelmetMTX = mtx.map((data) => {
return (
-
-

-
-
{data.name}
-
Rp.{data.price}
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
);
})
const ProductHelmetExtreme = extreme.map((data) => {
return (
-
-

-
-
{data.name}
-
Rp.{data.price}
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
);
})
const ProductHelmetRanger = ranger.map((data) => {
return (
-
-

-
-
{data.name}
-
Rp.{data.price}
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
);
})
const ProductHelmetFighter = fighter.map((data) => {
return (
-
-

-
-
{data.name}
-
Rp.{data.price}
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
);
})
const ProductHelmetSwirl = swirl.map((data) => {
return (
-
-

-
-
{data.name}
-
Rp.{data.price}
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
);
})
const ProductHelmetClassic = classic.map((data) => {
return (
-
-

-
-
{data.name}
-
Rp.{data.price}
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
);
})
const ProductHelmetUno = uno.map((data) => {
return (
-
-

-
-
{data.name}
-
Rp.{data.price}
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
);
})
diff --git a/pages-sections/product/product.js b/pages-sections/product/product.js
index 0dc955f..fdbc2fd 100644
--- a/pages-sections/product/product.js
+++ b/pages-sections/product/product.js
@@ -28,145 +28,193 @@ const DataProduct = function ({ backend, maxi, matic, naked, sport, offroad, mop
const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
const Productmaxi = maxi.map((data) => {
return (
-
-
-

-
{data.name}
-
Rp.{data.price}
-
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
+
);
})
const Productmatic = matic.map((data) => {
return (
-
-
-

-
{data.name}
-
Rp.{data.price}
-
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
+
);
})
const Productnaked = naked.map((data) => {
return (
-
-
-

-
{data.name}
-
Rp.{data.price}
-
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
+
);
})
const Productsport = sport.map((data) => {
return (
-
-
-

-
{data.name}
-
Rp.{data.price}
-
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
+
);
})
const Productoffroad = offroad.map((data) => {
return (
-
-
-

-
{data.name}
-
Rp.{data.price}
-
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
+
);
})
const Productmoped = moped.map((data) => {
return (
-
-
-

-
{data.name}
-
Rp.{data.price}
-
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
+
);
})
const Productmonsterenergy = monsterenergy.map((data) => {
return (
-
-
-

-
{data.name}
-
Rp.{data.price}
-
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
+
);
})
const Productcbu = cbu.map((data) => {
return (
-
-
-

-
{data.name}
-
Rp.{data.price}
-
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
+
);
})
diff --git a/pages-sections/product/yamalube.js b/pages-sections/product/yamalube.js
index a7274c3..465d8c1 100644
--- a/pages-sections/product/yamalube.js
+++ b/pages-sections/product/yamalube.js
@@ -24,23 +24,25 @@ const DataYamalube = function ({ selected, handleName, backend, yamalube, ...pro
const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
const ProductYamalube = yamalube.map((data) => {
return (
-
-

-
-
{data.name}
-
Rp.{data.price}
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
);
})
diff --git a/pages-sections/product/ygp.js b/pages-sections/product/ygp.js
index ae59935..06e3d31 100644
--- a/pages-sections/product/ygp.js
+++ b/pages-sections/product/ygp.js
@@ -24,18 +24,25 @@ const DataYGP = function ({ selected,handleName, backend, ygp, ...props }) {
const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
const ProductYGP = ygp.map((data) => {
return (
-
-

-
{data.name}
-
Rp.{data.price}
-
+
+
+
+
+

+
+
{data.name}
+ Rp.{data.price}
+
+
+
+
+
);
})
diff --git a/pages/latestnews_details.js b/pages/latestnews_details.js
index bca9ce5..ed02be2 100644
--- a/pages/latestnews_details.js
+++ b/pages/latestnews_details.js
@@ -14,7 +14,7 @@ import DetailLatestNews from "../pages-sections/latest_news/news_details.js";
const useStyles = makeStyles(styles);
-const detailLatestNews = function ({ backend, news, ...props }) {
+const detailLatestNews = function ({ backend, news, othernews, ...props }) {
const classes = useStyles();
const { ...rest } = props;
@@ -33,7 +33,7 @@ const detailLatestNews = function ({ backend, news, ...props }) {
-
+
@@ -45,12 +45,19 @@ export default detailLatestNews;
export async function getServerSideProps(context) {
var {query} = context;
var news = [];
+ var othernews = [];
const backend = process.env.BACKEND_SERVER_URI;
+
var res = await GetLatestNews.GetDetailNews(query.s||0);
if (res["STATUS"] === 1) {
news = res["DATA"]["latestNews"];
}
+
+ var res = await GetLatestNews.GetOtherNews();
+ if (res["STATUS"] === 1) {
+ othernews = res["DATA"]["latestNews"];
+ }
return {
- props: { news, backend }, // will be passed to the page component as props
+ props: { othernews, news, backend }, // will be passed to the page component as props
};
}
\ No newline at end of file
diff --git a/pages/product/apparel.js b/pages/product/apparel.js
index 1f9794d..05d8f20 100644
--- a/pages/product/apparel.js
+++ b/pages/product/apparel.js
@@ -9,7 +9,7 @@ import Footer from "components/Footer/Footer.js";
import Parallax from "components/Parallax/Parallax.js";
import styles from "assets/jss/nextjs-material-kit/pages/components.js";
-import GetDataApparel from "../../api/product/accessories.js";
+import GetDataApparel from "../../api/product/apparel.js";
import DataApparel from "../../pages-sections/product/apparel.js";
import DataSnackbarContent from "../../pages-sections/snackbar.js";
import Router from 'next/router'
@@ -22,7 +22,7 @@ const handleName = values => {
query: (values&&values.length!=0)?{ filter: values[0]["name"] }:{},
})
}
-const Apparel = function ({ selected, apparel, backend, ...props }) {
+const Apparel = function ({ selected, apparel, asia, basic, merchand, maxi, rainsuit, motogp, offroad, backend, ...props }) {
const classes = useStyles();
const { ...rest } = props;
return (
@@ -41,7 +41,7 @@ const Apparel = function ({ selected, apparel, backend, ...props }) {
-
+
@@ -53,21 +53,83 @@ export default Apparel;
export async function getServerSideProps(context) {
var apparel = [];
+ var asia = [];
+ var basic = [];
+ var merchand = [];
+ var maxi = [];
+ var rainsuit = [];
+ var motogp = [];
+ var offroad = [];
var filter = context.query.filter||"";
var selected = "";
const backend = process.env.BACKEND_SERVER_URI;
var res = await GetDataApparel.GetApparel(filter);
-
if (res["STATUS"] === 1) {
- apparel = res["DATA"]["accessories"];
+ apparel = res["DATA"]["apparels"];
if (filter !=""){
selected = apparel.filter((i)=>i.name==filter);
}
}
+ var res = await GetDataApparel.GetApparel46Asia(filter);
+ if (res["STATUS"] === 1) {
+ asia = res["DATA"]["apparels"];
+ if (filter !=""){
+ selected = asia.filter((i)=>i.name==filter);
+ }
+ }
+
+ var res = await GetDataApparel.GetApparelBasic(filter);
+ if (res["STATUS"] === 1) {
+ basic = res["DATA"]["apparels"];
+ if (filter !=""){
+ selected = basic.filter((i)=>i.name==filter);
+ }
+ }
+
+ var res = await GetDataApparel.GetApparelMerchandise(filter);
+ if (res["STATUS"] === 1) {
+ merchand = res["DATA"]["apparels"];
+ if (filter !=""){
+ selected = merchand.filter((i)=>i.name==filter);
+ }
+ }
+
+ var res = await GetDataApparel.GetApparelMaxi(filter);
+ if (res["STATUS"] === 1) {
+ maxi = res["DATA"]["apparels"];
+ if (filter !=""){
+ selected = maxi.filter((i)=>i.name==filter);
+ }
+ }
+
+ var res = await GetDataApparel.GetApparelRainSuit(filter);
+ if (res["STATUS"] === 1) {
+ rainsuit = res["DATA"]["apparels"];
+ if (filter !=""){
+ selected = rainsuit.filter((i)=>i.name==filter);
+ }
+ }
+
+ var res = await GetDataApparel.GetApparelMotoGP(filter);
+ if (res["STATUS"] === 1) {
+ motogp = res["DATA"]["apparels"];
+ if (filter !=""){
+ selected = motogp.filter((i)=>i.name==filter);
+ }
+ }
+
+ var res = await GetDataApparel.GetApparelOffRoad(filter);
+ if (res["STATUS"] === 1) {
+ offroad = res["DATA"]["apparels"];
+ if (filter !=""){
+ selected = offroad.filter((i)=>i.name==filter);
+ }
+ }
+
return {
- props: { selected, apparel, backend }, // will be passed to the page component as props
+ props: { selected, apparel, asia, basic, merchand, maxi, rainsuit, motogp, offroad, backend }, // will be passed to the page component as props
};
}
\ No newline at end of file
diff --git a/pages/product/apparel_details.js b/pages/product/apparel_details.js
index c378c03..f19ee4c 100644
--- a/pages/product/apparel_details.js
+++ b/pages/product/apparel_details.js
@@ -8,7 +8,7 @@ import Footer from "components/Footer/Footer.js";
import ApparelDetail from "pages-sections/product/apparel_details.js";
import Parallax from "components/Parallax/Parallax.js";
import styles from "assets/jss/nextjs-material-kit/pages/components.js";
-import GetDetailApparel from "../../api/product/accessories.js"
+import GetDetailApparel from "../../api/product/apparel.js"
const useStyles = makeStyles(styles);
@@ -43,11 +43,10 @@ export async function getServerSideProps(context) {
var detailapparel = [];
const backend = process.env.BACKEND_SERVER_URI;
- var res = await GetDetailApparel.GetDetailAccessories(query.s||0);
+ var res = await GetDetailApparel.GetDetailApparel(query.s||0);
if (res["STATUS"] === 1) {
- detailapparel = res["DATA"]["accessories"];
+ detailapparel = res["DATA"]["apparels"];
}
- console.log(detailapparel);
return {
props: { detailapparel, backend }, // will be passed to the page component as props