summaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-05-14 09:27:26 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-05-14 09:27:26 +0700
commit29ecab270822500ead372d8d3e05c9281a514715 (patch)
treea32735f4b7fab774de6a2bbee9380f363c51bec2 /src/pages
parentdd66804b05166ad6bb71bf54fe3374d9897fee86 (diff)
parent746a11b810ae9e8a974a76d0548297cd0faff9b5 (diff)
Merge branch 'new-release' into CR/form-merchant
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/api/flashsale-header.js2
-rw-r--r--src/pages/api/shop/search.js1
-rw-r--r--src/pages/api/webhook/biteship.js13
-rw-r--r--src/pages/google_merchant/products/[page].js3
-rw-r--r--src/pages/index.jsx14
-rw-r--r--src/pages/my/profile.jsx54
-rw-r--r--src/pages/my/tempo/index.jsx54
-rw-r--r--src/pages/pengajuan-tempo/index.jsx2
-rw-r--r--src/pages/sitemap/products/[page].js5
9 files changed, 92 insertions, 56 deletions
diff --git a/src/pages/api/flashsale-header.js b/src/pages/api/flashsale-header.js
index 578801ae..916a9cd2 100644
--- a/src/pages/api/flashsale-header.js
+++ b/src/pages/api/flashsale-header.js
@@ -35,7 +35,7 @@ export default async function handler(req, res) {
}
return res.status(200).json({ data });
} else {
- const flashSale = await odooApi('GET', `/api/v1/flashsale/header`);
+ const flashSale = await odooApi('GET', `/api/v1/flashsale/header?is_show_program=true`);
if (flashSale.length === 0) {
return res.status(200).json({ data: [] });
} else {
diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js
index 63ec7ca0..a1eecc52 100644
--- a/src/pages/api/shop/search.js
+++ b/src/pages/api/shop/search.js
@@ -19,6 +19,7 @@ export default async function handler(req, res) {
source = '',
} = req.query;
+
let { stock = '' } = req.query;
let paramOrderBy = '';
switch (orderBy) {
diff --git a/src/pages/api/webhook/biteship.js b/src/pages/api/webhook/biteship.js
new file mode 100644
index 00000000..f1100d2d
--- /dev/null
+++ b/src/pages/api/webhook/biteship.js
@@ -0,0 +1,13 @@
+import odooApi from '@/core/api/odooApi';
+
+
+export default async function handler(req, res) {
+ const body = req.body
+
+ if(req.body){
+ let result = odooApi('POST', '/api/v1/webhook/biteship', body)
+ }
+
+ res.status(200).send("ok");
+
+} \ No newline at end of file
diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js
index 8dd28a39..63d52d91 100644
--- a/src/pages/google_merchant/products/[page].js
+++ b/src/pages/google_merchant/products/[page].js
@@ -98,7 +98,8 @@ export async function getServerSideProps({ res, query }) {
'g:price': {
'#text': `${Math.round(product.lowestPrice.price * PPN)} IDR`,
},
- 'g:custom_label_3': {
+ // 'g:custom_label_3': { '#text': product.categories[0]?.name || 'Tidak Ada Kategori' },
+ 'g:custom_label_4': {
'#text': category_level_1?.name_s || 'Tidak Ada Kategori',
},
};
diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index fce2202a..df5047a3 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -97,6 +97,20 @@ export default function Home({ categoryId }) {
'indoteknik, indoteknik.com, toko teknik, toko perkakas, jual genset, jual fogging, jual krisbow, harga krisbow, harga alat safety, harga pompa air',
},
]}
+ openGraph={
+ {
+ title : 'Indoteknik.com: B2B Industrial Supply & Solution',
+ description : 'Temukan pilihan produk B2B Industri &amp; Alat Teknik untuk Perusahaan, UMKM &amp; Pemerintah dengan lengkap, mudah dan transparan.',
+ images: [
+ {
+ url: 'https://indoteknik.com/icon.jpg',
+ width: 800,
+ height: 600,
+ alt: 'indoteknik.com',
+ },
+ ],
+ }
+ }
/>
<PagePopupIformation />
diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx
index eaf3341c..859b6960 100644
--- a/src/pages/my/profile.jsx
+++ b/src/pages/my/profile.jsx
@@ -71,18 +71,19 @@ export default function Profile() {
<IsAuth>
<MobileView>
<AppLayout title='Akun Saya'>
- {!auth?.parentId && !ubahAkun && (
- <div className='text-sm p-4 flex items-center'>
- <Checkbox
- borderColor='gray.600'
- colorScheme='red'
- size='lg'
- isChecked={isChecked}
- onChange={handleChange}
- />
- <p className='ml-2'>Ubah ke akun bisnis</p>
- </div>
- )}
+ {auth?.company ||
+ (!ubahAkun && (
+ <div className='text-sm p-4 flex items-center'>
+ <Checkbox
+ borderColor='gray.600'
+ colorScheme='red'
+ size='lg'
+ isChecked={isChecked}
+ onChange={handleChange}
+ />
+ <p className='ml-2'>Ubah ke akun bisnis</p>
+ </div>
+ ))}
{isChecked && (
<div>
<SwitchAccount company_type='nonpkp' />
@@ -97,7 +98,7 @@ export default function Profile() {
)} */}
<PersonalProfile />
<Divider />
- {auth?.parentId && <CompanyProfile />}
+ {(auth?.parentId || auth?.company) && <CompanyProfile />}
</AppLayout>
</MobileView>
@@ -108,18 +109,19 @@ export default function Profile() {
<Menu />
</div>
<div className='w-9/12 bg-white border border-gray_r-6 rounded'>
- {!auth?.parentId && !ubahAkun && (
- <div className='text-sm p-4 flex items-center'>
- <Checkbox
- borderColor='gray.600'
- colorScheme='red'
- size='lg'
- isChecked={isChecked}
- onChange={handleChange}
- />
- <p className='ml-2'>Ubah ke akun bisnis</p>
- </div>
- )}
+ {auth?.company ||
+ (!ubahAkun && (
+ <div className='text-sm p-4 flex items-center'>
+ <Checkbox
+ borderColor='gray.600'
+ colorScheme='red'
+ size='lg'
+ isChecked={isChecked}
+ onChange={handleChange}
+ />
+ <p className='ml-2'>Ubah ke akun bisnis</p>
+ </div>
+ ))}
{isChecked && (
<div>
<SwitchAccount company_type='nonpkp' />
@@ -134,7 +136,7 @@ export default function Profile() {
)} */}
<PersonalProfile />
<Divider />
- {auth?.parentId && <CompanyProfile />}
+ {(auth?.parentId || auth?.company) && <CompanyProfile />}
</div>
</div>
</BasicLayout>
diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx
index 5fb9deba..6ca5c718 100644
--- a/src/pages/my/tempo/index.jsx
+++ b/src/pages/my/tempo/index.jsx
@@ -13,39 +13,41 @@ export default function MyTempo() {
const router = useRouter();
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
+ setIsLoading(true);
if (!auth) {
const nextUrl = encodeURIComponent(router.asPath);
router.push(`/login?next=${nextUrl}`);
- }
- // else if (
- // (auth.tempoProgres === '' || auth.tempoProgres === 'rejected') &&
- // !auth.company
- // ) {
- // router.push('/pengajuan-tempo');
- // }
- else {
+ } else {
+ if (
+ !auth.partnerTempo &&
+ (!auth.partnerTempo || auth.tempoProgres === 'review')
+ ) {
+ setIsLoading(true);
+ router.push('/pengajuan-tempo');
+ }
setIsLoading(false);
}
}, [auth]);
- if (isLoading || !auth) {
- return null; // Tidak render apa pun selama loading atau auth/tempo belum tersedia
- }
- return (
- <IsAuth>
- <Seo title='Tempo - Indoteknik.com' />
+ if (isLoading && !auth) {
+ return null;
+ } else {
+ return (
+ <IsAuth>
+ <Seo title='Tempo - Indoteknik.com' />
- <MobileView>
- <AppLayout title='Pembayaran Tempo'>
- <InvoicesComponent />
- </AppLayout>
- </MobileView>
+ <MobileView>
+ <AppLayout title='Pembayaran Tempo'>
+ <InvoicesComponent />
+ </AppLayout>
+ </MobileView>
- <DesktopView>
- <BasicLayout>
- <InvoicesComponent />
- </BasicLayout>
- </DesktopView>
- </IsAuth>
- );
+ <DesktopView>
+ <BasicLayout>
+ <InvoicesComponent />
+ </BasicLayout>
+ </DesktopView>
+ </IsAuth>
+ );
+ }
}
diff --git a/src/pages/pengajuan-tempo/index.jsx b/src/pages/pengajuan-tempo/index.jsx
index 6987bd29..5ddd3e18 100644
--- a/src/pages/pengajuan-tempo/index.jsx
+++ b/src/pages/pengajuan-tempo/index.jsx
@@ -48,7 +48,7 @@ export default function TrackingOrder() {
router.push(`/login?next=${nextUrl}`);
} else if (auth.tempoProgres === 'approve' || auth?.partnerTempo) {
router.push('/pengajuan-tempo/approve');
- } else if (!auth.parentId) {
+ } else if (!auth.parentId && !auth.company) {
router.push('/pengajuan-tempo/switch-account');
} else if (auth.tempoProgres === 'review' && !tempo?.paymentTerm) {
router.push('/pengajuan-tempo/review');
diff --git a/src/pages/sitemap/products/[page].js b/src/pages/sitemap/products/[page].js
index e39755d6..3419489b 100644
--- a/src/pages/sitemap/products/[page].js
+++ b/src/pages/sitemap/products/[page].js
@@ -7,7 +7,10 @@ export async function getServerSideProps({ query, res }) {
const baseUrl = process.env.SELF_HOST + '/shop/product/'
const { page } = query
const limit = 2500
- const queries = { limit, page: page.replace('.xml', '') }
+ const queries = { limit, page: page.replace('.xml', ''),
+ '-publish_b': false,
+ product_rating_f: '[8 TO *]',
+ price_tier1_v2_f: '[1 TO *]', }
const products = await productSearchApi({ query: _.toQuery(queries) })
const sitemap = create('urlset', { encoding: 'utf-8' }).att(
'xmlns',