From 8c906c98b2a2994286731357831ca8005ef0d73f Mon Sep 17 00:00:00 2001
From: MikunoNaka <bokuwakanojogahoshii@yahoo.com>
Date: Sun, 8 Aug 2021 16:11:08 +0530
Subject: Added better support for saving client data

---
 src/components/Pages/BillingPage.tsx | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

(limited to 'src/components/Pages/BillingPage.tsx')

diff --git a/src/components/Pages/BillingPage.tsx b/src/components/Pages/BillingPage.tsx
index 58fdd40..9dcb485 100644
--- a/src/components/Pages/BillingPage.tsx
+++ b/src/components/Pages/BillingPage.tsx
@@ -56,13 +56,6 @@ const BillingPage: React.FC = () => {
   // update the items from AddNewItemForm
   const getItems = (item: Item) => setItems([...items, item]);
 
-  const handleSubmit = () => {
-    setShowSubmitMenu(true);
-    axios.post(`/api/invoices/preview`, {ID: 1010, Items: items, Transporter: transporter})
-      .then(() => alert("yay"))
-      .catch(() => alert("nay"));
-  }
-
   return (
     <>
       {registerItemFormVisibility &&
@@ -83,8 +76,8 @@ const BillingPage: React.FC = () => {
       {showTransportForm &&
         <TransportForm
           setVisibility={setShowTransportForm}
-          currentTransporter={transporter}
           setTransporter={setTransporter}
+          currentTransporter={transporter}
         />
       }
 
@@ -119,8 +112,12 @@ const BillingPage: React.FC = () => {
         <InvoiceInfoMenu
           setShowTransportForm={setShowTransportForm}
         />
+
+        <button onClick={() => setShowSubmitMenu(true)}>
+          post (experimental)
+        </button>
+
         <SummaryDisplay items={items}/>
-        <button onClick={handleSubmit}>post (experimental)</button>
       </div>
     </>
   );
-- 
cgit v1.2.3

