From cf1ca71d507118c2a97f868435cfd7ad529d965c Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 2 Jan 2025 08:53:54 +0700 Subject: update merchant --- src/pages/daftar-merchant.jsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/pages') diff --git a/src/pages/daftar-merchant.jsx b/src/pages/daftar-merchant.jsx index e1fa9bcb..c224ed0d 100644 --- a/src/pages/daftar-merchant.jsx +++ b/src/pages/daftar-merchant.jsx @@ -1,15 +1,19 @@ -import Seo from '@/core/components/Seo' -import BasicLayout from '@/core/components/layouts/BasicLayout' -import CreateMerchant from '@/lib/form/components/Merchant' - +import Seo from '@/core/components/Seo'; +import BasicLayout from '@/core/components/layouts/BasicLayout'; +import CreateMerchant from '@/lib/form/components/Merchant'; +import ErrorMerchant from '@/lib/form/components/AccountSwitch'; +import useAuth from '@/core/hooks/useAuth'; +import { useRouter } from 'next/router'; export default function DaftarMerchant() { + const router = useRouter(); + const auth = useAuth(); return ( <> - + {auth?.company ? : } - ) + ); } -- cgit v1.2.3 From 360498a3dd90cebffb0911d6eed32ef29299869b Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 2 Jan 2025 10:26:45 +0700 Subject: update merchant --- src/pages/daftar-merchant.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/pages') diff --git a/src/pages/daftar-merchant.jsx b/src/pages/daftar-merchant.jsx index c224ed0d..8616cc46 100644 --- a/src/pages/daftar-merchant.jsx +++ b/src/pages/daftar-merchant.jsx @@ -7,12 +7,22 @@ import { useRouter } from 'next/router'; export default function DaftarMerchant() { const router = useRouter(); const auth = useAuth(); + if (auth == false) { + router.push(`/login?next=${encodeURIComponent('/daftar-merchant')}`); + } + if (!auth) { + return; + } return ( <> - {auth?.company ? : } + {auth && auth?.company ? ( + + ) : ( + + )} ); -- cgit v1.2.3 From e1ecdbe5dd1857d1aa2f3317c0d763241ebaa6e5 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 9 Jan 2025 17:09:17 +0700 Subject: update code --- src/pages/daftar-merchant.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pages') diff --git a/src/pages/daftar-merchant.jsx b/src/pages/daftar-merchant.jsx index 8616cc46..b51589e8 100644 --- a/src/pages/daftar-merchant.jsx +++ b/src/pages/daftar-merchant.jsx @@ -1,7 +1,7 @@ import Seo from '@/core/components/Seo'; import BasicLayout from '@/core/components/layouts/BasicLayout'; -import CreateMerchant from '@/lib/form/components/Merchant'; -import ErrorMerchant from '@/lib/form/components/AccountSwitch'; +import CreateMerchant from '@/lib/merchant/components/Merchant'; +import ErrorMerchant from '@/lib/merchant/components/AccountSwitch'; import useAuth from '@/core/hooks/useAuth'; import { useRouter } from 'next/router'; export default function DaftarMerchant() { -- cgit v1.2.3 From 4a23d0c7c880b67d571ca34efe93cbf2c1bba721 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 22 Jan 2025 13:16:05 +0700 Subject: update merchant --- src/pages/daftar-merchant.jsx | 29 ----------------------------- src/pages/daftar-merchant/[status].jsx | 0 src/pages/daftar-merchant/index.jsx | 25 +++++++++++++++++++++++++ 3 files changed, 25 insertions(+), 29 deletions(-) delete mode 100644 src/pages/daftar-merchant.jsx create mode 100644 src/pages/daftar-merchant/[status].jsx create mode 100644 src/pages/daftar-merchant/index.jsx (limited to 'src/pages') diff --git a/src/pages/daftar-merchant.jsx b/src/pages/daftar-merchant.jsx deleted file mode 100644 index b51589e8..00000000 --- a/src/pages/daftar-merchant.jsx +++ /dev/null @@ -1,29 +0,0 @@ -import Seo from '@/core/components/Seo'; -import BasicLayout from '@/core/components/layouts/BasicLayout'; -import CreateMerchant from '@/lib/merchant/components/Merchant'; -import ErrorMerchant from '@/lib/merchant/components/AccountSwitch'; -import useAuth from '@/core/hooks/useAuth'; -import { useRouter } from 'next/router'; -export default function DaftarMerchant() { - const router = useRouter(); - const auth = useAuth(); - if (auth == false) { - router.push(`/login?next=${encodeURIComponent('/daftar-merchant')}`); - } - if (!auth) { - return; - } - return ( - <> - - - - {auth && auth?.company ? ( - - ) : ( - - )} - - - ); -} diff --git a/src/pages/daftar-merchant/[status].jsx b/src/pages/daftar-merchant/[status].jsx new file mode 100644 index 00000000..e69de29b diff --git a/src/pages/daftar-merchant/index.jsx b/src/pages/daftar-merchant/index.jsx new file mode 100644 index 00000000..8ea6cfd1 --- /dev/null +++ b/src/pages/daftar-merchant/index.jsx @@ -0,0 +1,25 @@ +import Seo from '@/core/components/Seo'; +import BasicLayout from '@/core/components/layouts/BasicLayout'; +import CreateMerchant from '@/lib/merchant/components/Merchant'; +import ErrorMerchant from '@/lib/merchant/components/AccountSwitch'; +import useAuth from '@/core/hooks/useAuth'; +import { useRouter } from 'next/router'; +export default function DaftarMerchant() { + const router = useRouter(); + const auth = useAuth(); + if (auth == false) { + router.push(`/login?next=${encodeURIComponent('/daftar-merchant')}`); + } + if (!auth) { + return; + } + return ( + <> + + + + {auth && auth?.company ? : } + + + ); +} -- cgit v1.2.3 From dd66804b05166ad6bb71bf54fe3374d9897fee86 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Wed, 22 Jan 2025 16:32:14 +0700 Subject: handle approce atau review merchant --- src/pages/daftar-merchant/[status].jsx | 47 ++++++++++++++++++++++++++++++++++ src/pages/daftar-merchant/index.jsx | 30 +++++++++++++++++++++- 2 files changed, 76 insertions(+), 1 deletion(-) (limited to 'src/pages') diff --git a/src/pages/daftar-merchant/[status].jsx b/src/pages/daftar-merchant/[status].jsx index e69de29b..61c07571 100644 --- a/src/pages/daftar-merchant/[status].jsx +++ b/src/pages/daftar-merchant/[status].jsx @@ -0,0 +1,47 @@ +import BasicLayout from '@/core/components/layouts/BasicLayout'; +import IsAuth from '@/lib/auth/components/IsAuth'; +import StatusMerchant from '@/lib/merchant/components/AccountSwitch'; +import { useRouter } from 'next/router'; +import axios from 'axios'; +import { useState, useEffect } from 'react'; +import Seo from '@/core/components/Seo'; +import { getAuth } from '~/libs/auth'; + +export async function getServerSideProps(context) { + const { status } = context.query; + // await axios.post( + // `${process.env.NEXT_PUBLIC_SELF_HOST}/api/pengajuan-tempo/${status}`, + // {}, + // { headers: context.req.headers } + // ); + return { props: {} }; +} + +export default function Finish() { + const [isLoading, setIsLoading] = useState(true); + const router = useRouter(); + const auth = getAuth(); + useEffect(() => { + if (!auth) { + const nextUrl = encodeURIComponent(router.asPath); + router.push(`/login?next=${nextUrl}`); + } else { + setIsLoading(false); + } + }, [auth]); + + if (isLoading || !auth) { + return null; // Tidak render apa pun selama loading atau auth/tempo belum tersedia + } + return ( + <> + + + + + + + + + ); +} diff --git a/src/pages/daftar-merchant/index.jsx b/src/pages/daftar-merchant/index.jsx index 8ea6cfd1..36fedafc 100644 --- a/src/pages/daftar-merchant/index.jsx +++ b/src/pages/daftar-merchant/index.jsx @@ -2,15 +2,43 @@ import Seo from '@/core/components/Seo'; import BasicLayout from '@/core/components/layouts/BasicLayout'; import CreateMerchant from '@/lib/merchant/components/Merchant'; import ErrorMerchant from '@/lib/merchant/components/AccountSwitch'; +import getMerchantProgresApi from '@/lib/merchant/api/getMerchantProgresApi'; import useAuth from '@/core/hooks/useAuth'; import { useRouter } from 'next/router'; +import React, { useEffect, useState } from 'react'; export default function DaftarMerchant() { const router = useRouter(); const auth = useAuth(); + const [isLoading, setIsLoading] = useState(true); + useEffect(() => { + const loadData = async () => { + setIsLoading(true); + try { + const data = await getMerchantProgresApi(); + switch (data) { + case 'draft': + router.push(`/daftar-merchant/review`); + break; + case 'approve': + router.push(`/daftar-merchant/approve`); + break; + case 'reject': + router.push(`/daftar-merchant/reject`); + break; + } + } catch (error) { + console.error('Error loading profile:', error); + handleIsError(true); // Jika ada error, panggil fungsi error handler + } + setIsLoading(false); + }; + + loadData(); + }, []); if (auth == false) { router.push(`/login?next=${encodeURIComponent('/daftar-merchant')}`); } - if (!auth) { + if (!auth || isLoading) { return; } return ( -- cgit v1.2.3 From d9ffc1e045a75629d9debfac12b8be340b57c70c Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Wed, 19 Mar 2025 16:58:23 +0700 Subject: api webhook biteshi[ --- src/pages/api/webhook/biteship.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/pages/api/webhook/biteship.js (limited to 'src/pages') 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 -- cgit v1.2.3 From f13517139cd9f69488ae44582d90990eab472aa4 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Tue, 29 Apr 2025 11:27:29 +0700 Subject: bug fixing flash sale header --- src/pages/api/flashsale-header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages') 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 { -- cgit v1.2.3 From 480e89a0d2ccd274b956b4c4fb7ff520765c6606 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 29 Apr 2025 14:53:53 +0700 Subject: fix bug flashsale --- src/pages/api/shop/search.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pages') 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) { -- cgit v1.2.3 From 77e49bf7f69a0712da632ddec5b9bd0926389955 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Mon, 26 May 2025 14:23:40 +0700 Subject: filter based on stock quantity for ready stock page --- src/pages/api/shop/search.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pages') diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index a1eecc52..8ab5c87c 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -89,6 +89,10 @@ export default async function handler(req, res) { 'price_tier1_v2_f:[1 TO *]', ]; + if (orderBy === 'stock') { + filterQueries.push('stock_total_f:{0 TO *}'); // Hanya produk dengan stock > 0 + } + if (fq && source != 'similar' && typeof fq != 'string') { // filterQueries.push(fq); fq.push(...filterQueries); -- cgit v1.2.3 From 96ba337041e6b157abc8e6f7def1525e340be21a Mon Sep 17 00:00:00 2001 From: Miqdad Date: Mon, 26 May 2025 15:12:21 +0700 Subject: push ulang --- src/pages/api/shop/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages') diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index 8ab5c87c..e14b0ca2 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -90,7 +90,7 @@ export default async function handler(req, res) { ]; if (orderBy === 'stock') { - filterQueries.push('stock_total_f:{0 TO *}'); // Hanya produk dengan stock > 0 + filterQueries.push('stock_total_f:{0 TO *}'); } if (fq && source != 'similar' && typeof fq != 'string') { -- cgit v1.2.3 From 3d91a6e1ac168d0749cd816c1ea99b44336ffa0c Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 26 May 2025 16:20:09 +0700 Subject: --- src/pages/daftar-merchant.jsx | 15 ++++++++++ src/pages/daftar-merchant/[status].jsx | 47 ------------------------------ src/pages/daftar-merchant/index.jsx | 53 ---------------------------------- 3 files changed, 15 insertions(+), 100 deletions(-) create mode 100644 src/pages/daftar-merchant.jsx delete mode 100644 src/pages/daftar-merchant/[status].jsx delete mode 100644 src/pages/daftar-merchant/index.jsx (limited to 'src/pages') diff --git a/src/pages/daftar-merchant.jsx b/src/pages/daftar-merchant.jsx new file mode 100644 index 00000000..945a0060 --- /dev/null +++ b/src/pages/daftar-merchant.jsx @@ -0,0 +1,15 @@ +import Seo from '@/core/components/Seo' +import BasicLayout from '@/core/components/layouts/BasicLayout' +import CreateMerchant from '@/lib/form/components/Merchant' + +export default function DaftarMerchant() { + return ( + <> + + + + + + + ) +} \ No newline at end of file diff --git a/src/pages/daftar-merchant/[status].jsx b/src/pages/daftar-merchant/[status].jsx deleted file mode 100644 index 61c07571..00000000 --- a/src/pages/daftar-merchant/[status].jsx +++ /dev/null @@ -1,47 +0,0 @@ -import BasicLayout from '@/core/components/layouts/BasicLayout'; -import IsAuth from '@/lib/auth/components/IsAuth'; -import StatusMerchant from '@/lib/merchant/components/AccountSwitch'; -import { useRouter } from 'next/router'; -import axios from 'axios'; -import { useState, useEffect } from 'react'; -import Seo from '@/core/components/Seo'; -import { getAuth } from '~/libs/auth'; - -export async function getServerSideProps(context) { - const { status } = context.query; - // await axios.post( - // `${process.env.NEXT_PUBLIC_SELF_HOST}/api/pengajuan-tempo/${status}`, - // {}, - // { headers: context.req.headers } - // ); - return { props: {} }; -} - -export default function Finish() { - const [isLoading, setIsLoading] = useState(true); - const router = useRouter(); - const auth = getAuth(); - useEffect(() => { - if (!auth) { - const nextUrl = encodeURIComponent(router.asPath); - router.push(`/login?next=${nextUrl}`); - } else { - setIsLoading(false); - } - }, [auth]); - - if (isLoading || !auth) { - return null; // Tidak render apa pun selama loading atau auth/tempo belum tersedia - } - return ( - <> - - - - - - - - - ); -} diff --git a/src/pages/daftar-merchant/index.jsx b/src/pages/daftar-merchant/index.jsx deleted file mode 100644 index 36fedafc..00000000 --- a/src/pages/daftar-merchant/index.jsx +++ /dev/null @@ -1,53 +0,0 @@ -import Seo from '@/core/components/Seo'; -import BasicLayout from '@/core/components/layouts/BasicLayout'; -import CreateMerchant from '@/lib/merchant/components/Merchant'; -import ErrorMerchant from '@/lib/merchant/components/AccountSwitch'; -import getMerchantProgresApi from '@/lib/merchant/api/getMerchantProgresApi'; -import useAuth from '@/core/hooks/useAuth'; -import { useRouter } from 'next/router'; -import React, { useEffect, useState } from 'react'; -export default function DaftarMerchant() { - const router = useRouter(); - const auth = useAuth(); - const [isLoading, setIsLoading] = useState(true); - useEffect(() => { - const loadData = async () => { - setIsLoading(true); - try { - const data = await getMerchantProgresApi(); - switch (data) { - case 'draft': - router.push(`/daftar-merchant/review`); - break; - case 'approve': - router.push(`/daftar-merchant/approve`); - break; - case 'reject': - router.push(`/daftar-merchant/reject`); - break; - } - } catch (error) { - console.error('Error loading profile:', error); - handleIsError(true); // Jika ada error, panggil fungsi error handler - } - setIsLoading(false); - }; - - loadData(); - }, []); - if (auth == false) { - router.push(`/login?next=${encodeURIComponent('/daftar-merchant')}`); - } - if (!auth || isLoading) { - return; - } - return ( - <> - - - - {auth && auth?.company ? : } - - - ); -} -- cgit v1.2.3