summaryrefslogtreecommitdiff
path: root/src/pages/my/transactions/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/my/transactions/index.js')
-rw-r--r--src/pages/my/transactions/index.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/pages/my/transactions/index.js b/src/pages/my/transactions/index.js
index eb5f99a1..7792c647 100644
--- a/src/pages/my/transactions/index.js
+++ b/src/pages/my/transactions/index.js
@@ -8,6 +8,7 @@ import { useAuth } from "../../../helpers/auth";
import apiOdoo from "../../../helpers/apiOdoo";
import currencyFormat from "../../../helpers/currencyFormat";
import { EllipsisVerticalIcon } from "@heroicons/react/24/outline";
+import Link from "../../../components/Link";
export default function Transactions() {
const [ auth ] = useAuth();
@@ -19,7 +20,7 @@ export default function Transactions() {
useEffect(() => {
const loadTransactions = async () => {
if (auth) {
- const dataTransactions = await apiOdoo('GET', `/api/v1/sale_order?partner_id=${auth?.partner_id}`);
+ const dataTransactions = await apiOdoo('GET', `/api/v1/partner/${auth.partner_id}/sale_order`);
setTransactions(dataTransactions);
};
}
@@ -29,31 +30,31 @@ export default function Transactions() {
return (
<WithAuth>
<Layout>
- <AppBar title="Daftar Transaksi" />
+ <AppBar title="Transaksi" />
<div className="p-4 flex flex-col gap-y-4">
{ transactions?.sale_orders?.map((transaction, index) => (
<div className="p-4 border border-gray_r-7 rounded-md" key={index}>
- <div className="flex justify-between">
- <div>
+ <div className="grid grid-cols-2">
+ <Link href={`/my/transactions/${transaction.id}`}>
<span className="text-caption-2 text-gray_r-11">No. Transaksi</span>
<h2 className="text-red_r-11 mt-1">{ transaction.name }</h2>
- </div>
- <div className="flex gap-x-1">
+ </Link>
+ <div className="flex gap-x-1 justify-end">
<div className="badge-green h-fit">Pending</div>
<EllipsisVerticalIcon className="w-5 h-5" onClick={() => setActivePopupId(transaction.id)} />
</div>
</div>
- <div className="flex mt-2 justify-between">
+ <Link href={`/my/transactions/${transaction.id}`} className="grid grid-cols-2 mt-3">
<div>
<span className="text-caption-2 text-gray_r-11">Dilayani Oleh</span>
- <p className="mt-1 font-medium">{ transaction.sales }</p>
+ <p className="mt-1 font-medium text-gray_r-12">{ transaction.sales }</p>
</div>
<div className="text-right">
<span className="text-caption-2 text-gray_r-11">Total Harga</span>
- <p className="mt-1 font-medium">{ currencyFormat(transaction.amount_total) }</p>
+ <p className="mt-1 font-medium text-gray_r-12">{ currencyFormat(transaction.amount_total) }</p>
</div>
- </div>
+ </Link>
</div>
)) }
</div>