{
- console.log(selecteditems);
- const data = await TransactionCreateAPI({
- equipments: selecteditems,
- teacher: selectedteacher,
- subject: subject,
- remarks: remarks || " ",
- transaction_status: "Pending Approval",
- consumables: consumables || "",
- borrower: user.data?.id || 0,
- });
+ console.log(JSON.stringify(transaction));
+ const data = await TransactionCreateAPI(transaction);
if (data[0]) {
setError("Created successfully");
toast(
diff --git a/src/Pages/TransactionPage/TransactionPage.tsx b/src/Pages/TransactionPage/TransactionPage.tsx
index 7fd91ee..f4d7d5a 100644
--- a/src/Pages/TransactionPage/TransactionPage.tsx
+++ b/src/Pages/TransactionPage/TransactionPage.tsx
@@ -15,25 +15,6 @@ export default function TransactionPage() {
queryKey: ["transaction", id],
queryFn: () => TransactionAPI(Number(id) || 0),
});
- const blank_transaction = {
- id: 0,
- borrower: {
- id: 0,
- name: "",
- course: "",
- },
- teacher: {
- id: 0,
- name: "",
- },
- equipments: [],
- transaction_status: "",
- timestamp: "",
- remarks: "",
- subject: "",
- consumables: "",
- };
-
if (transaction.isLoading) {
return (
<>
@@ -75,11 +56,7 @@ export default function TransactionPage() {
}}
>
- }
+ document={
}
fileName="transaction.pdf"
>
{({ loading }) =>
@@ -87,7 +64,7 @@ export default function TransactionPage() {
}
-
+
diff --git a/src/Pages/TransactionReportPage/TransactionReportPage.tsx b/src/Pages/TransactionReportPage/TransactionReportPage.tsx
index 1cb32bf..d44504d 100644
--- a/src/Pages/TransactionReportPage/TransactionReportPage.tsx
+++ b/src/Pages/TransactionReportPage/TransactionReportPage.tsx
@@ -11,24 +11,6 @@ export default function TransactionReportPage() {
queryKey: ["transactions"],
queryFn: TransactionsAPI,
});
- const blank_transaction = {
- id: 0,
- borrower: {
- id: 0,
- name: "",
- course: "",
- },
- teacher: {
- id: 0,
- name: "",
- },
- equipments: [],
- transaction_status: "",
- timestamp: "",
- remarks: "",
- subject: "",
- consumables: "",
- };
if (transactions.isLoading) {
return (
@@ -77,7 +59,7 @@ export default function TransactionReportPage() {
}
@@ -89,7 +71,7 @@ export default function TransactionReportPage() {