From 1e89e64ec0bccbe89b9cede0b2054547d40589fa Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 22 May 2023 15:27:01 +0700 Subject: Refactor hero banner and popular product section --- src/api/productApi.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/api/productApi.js (limited to 'src/api/productApi.js') diff --git a/src/api/productApi.js b/src/api/productApi.js new file mode 100644 index 00000000..cca052f7 --- /dev/null +++ b/src/api/productApi.js @@ -0,0 +1,10 @@ +import axios from 'axios' + +export const popularProductApi = () => { + return async () => { + const dataPopularProducts = await axios( + `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/search?q=*&page=1&orderBy=popular` + ) + return dataPopularProducts.data.response + } +} -- cgit v1.2.3