forked from summit-webapp-themes/maxima
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quick-order.tsx
38 lines (34 loc) · 1.12 KB
/
quick-order.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React from "react";
import QuickOrderMaster from "../components/QuickOrder/QuickOrderMaster";
import MetaTag from "../services/api/general_apis/meta-tag-api";
import { CONSTANTS } from "../services/config/app-config";
const QuickOrder = () => {
return (
<>
<QuickOrderMaster />
</>
);
};
export async function getServerSideProps(context: any) {
const method = "get_meta_tags";
const version = "v1";
const entity = "seo";
const params = `?version=${version}&method=${method}&entity=${entity}`;
const url = `${context.resolvedUrl.split("?")[0]}`;
console.log("context url", context.resolvedUrl);
if (CONSTANTS.ENABLE_META_TAGS) {
let meta_data: any = await MetaTag(
`${CONSTANTS.API_BASE_URL}${CONSTANTS.API_MANDATE_PARAMS}${params}&page_name=${url}`
);
if (meta_data !== null && Object.keys(meta_data).length > 0) {
const metaData = meta_data?.data?.message?.data;
// console.log("meta data in page server", metaData);
return { props: { metaData } };
} else {
return { props: {} };
}
} else {
return { props: {} };
}
}
export default QuickOrder;