summaryrefslogtreecommitdiff
path: root/src/lib/promo/api/productSearchApi.js
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-09-20 16:52:16 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-09-20 16:52:16 +0700
commita784f4623448ff846dbc5c8259405e6cce8fffb7 (patch)
tree016da331ea5a18ef2c3c1264728b1199b5e9172a /src/lib/promo/api/productSearchApi.js
parent1db54e16f970b4e09df89d432efd5a66ac775eb6 (diff)
parentb7e7696d675d0c2e36364f7cbedb0483a343048d (diff)
Merge branch 'release' into Feature/new-register
Diffstat (limited to 'src/lib/promo/api/productSearchApi.js')
-rw-r--r--src/lib/promo/api/productSearchApi.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/promo/api/productSearchApi.js b/src/lib/promo/api/productSearchApi.js
new file mode 100644
index 00000000..2f792fd4
--- /dev/null
+++ b/src/lib/promo/api/productSearchApi.js
@@ -0,0 +1,11 @@
+import _ from 'lodash-contrib'
+import axios from 'axios'
+
+const productSearchApi = async ({ query, operation = 'AND' }) => {
+ const dataProductSearch = await axios(
+ `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/promo?${query}&operation=${operation}`
+ )
+ return dataProductSearch.data
+}
+
+export default productSearchApi