diff options
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/bannerApi.js (renamed from src/api/BannerApi.js) | 2 | ||||
| -rw-r--r-- | src/api/productApi.js | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/api/BannerApi.js b/src/api/bannerApi.js index 8ebecd26..8bae131d 100644 --- a/src/api/BannerApi.js +++ b/src/api/bannerApi.js @@ -1,5 +1,5 @@ import odooApi from '@/core/api/odooApi' -export const BannerApi = ({ type }) => { +export const bannerApi = ({ type }) => { return async () => await odooApi('GET', `/api/v1/banner?type=${type}`) } 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 + } +} |
