summaryrefslogtreecommitdiff
path: root/src/lib/brand
diff options
context:
space:
mode:
authortrisusilo <tri.susilo@altama.co.id>2023-09-26 03:08:32 +0000
committertrisusilo <tri.susilo@altama.co.id>2023-09-26 03:08:32 +0000
commite0fde9bb4ef9299d78dae82221e6b16294d6c597 (patch)
treedc0e45f8bbb2ed74c9df3a5b71c86154bce66648 /src/lib/brand
parent2471cde6bdfbcc3bbc76f26656fdc79bd1f6bdb1 (diff)
parent834b057ecb8eb1af06160b01c623332a35b169fa (diff)
Merged in CR/migrasi_brand_homepage&all_brand (pull request #79)
CR/migrasi brand homepage&all brand
Diffstat (limited to 'src/lib/brand')
-rw-r--r--src/lib/brand/components/Brands.jsx15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/brand/components/Brands.jsx b/src/lib/brand/components/Brands.jsx
index c7483e40..f6cb4fbf 100644
--- a/src/lib/brand/components/Brands.jsx
+++ b/src/lib/brand/components/Brands.jsx
@@ -1,7 +1,7 @@
-import odooApi from '@/core/api/odooApi'
import { useCallback, useEffect, useState } from 'react'
import BrandCard from './BrandCard'
import LogoSpinner from '@/core/components/elements/Spinner/LogoSpinner'
+import axios from 'axios'
const Brands = () => {
const alpha = Array.from(Array(26)).map((e, i) => i + 65)
@@ -13,13 +13,18 @@ const Brands = () => {
const loadBrand = useCallback(async () => {
setIsLoading(true)
- const name = startWith ? `${startWith}%` : ''
- const result = await odooApi(
+ const name = startWith ? `${startWith}*` : ''
+ //Get brand from odoo
+ /*const result = await odooApi(
'GET',
`/api/v1/manufacture?limit=0&offset=${manufactures.length}&name=${name}`
- )
+ )*/
+
+ // Change get brands from solr
+ const result = await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands?params=${name}`)
+
setIsLoading(false)
- setManufactures((manufactures) => [...manufactures, ...result.manufactures])
+ setManufactures((manufactures) => [...result.data])
}, [startWith])
const toggleStartWith = (alphabet) => {