diff options
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 + } +} |
