diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-22 15:27:01 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-22 15:27:01 +0700 |
| commit | 1e89e64ec0bccbe89b9cede0b2054547d40589fa (patch) | |
| tree | 7910f4fa4b8526ac23cff814aa0f3983aebb874d /src/api/productApi.js | |
| parent | 33da0fcb718335eb1d077af4321ac65e0146a2d6 (diff) | |
Refactor hero banner and popular product section
Diffstat (limited to 'src/api/productApi.js')
| -rw-r--r-- | src/api/productApi.js | 10 |
1 files changed, 10 insertions, 0 deletions
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 + } +} |
