From 5846185f5a6662265c5330fbed229f49efb26b89 Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Mon, 3 May 2021 12:26:47 +0530 Subject: added some features and many bugs to DocumentInfoForm --- src/components/BillingPage.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/components/BillingPage.js') diff --git a/src/components/BillingPage.js b/src/components/BillingPage.js index be2e299..40917e5 100644 --- a/src/components/BillingPage.js +++ b/src/components/BillingPage.js @@ -14,6 +14,7 @@ import RegisterItemForm from "./Form/Items/RegisterItemForm"; import RegisterPersonForm from "./Form/People/RegisterPersonForm"; +import DocumentInfoForm from "./Form/Document/DocumentInfoForm"; import MetaInfoForm from "./Form/MetaInfoForm"; import ItemsDisplay from "./Display/ItemsDisplay"; @@ -21,6 +22,7 @@ import SummaryDisplay from "./Display/SummaryDisplay"; const BillingPage = () => { const [savedItems, getSavedItems] = useState([]); + const [savedPeople, getSavedPeople] = useState([]); const [registerItemFormVisibility, setRegisterItemFormVisibility] = useState(false); const [registerPersonFormVisibility, setRegisterPersonFormVisibility] = useState(false); @@ -35,9 +37,21 @@ const BillingPage = () => { }) } + const getRegisteredPeople = () => { + axios.get(`/api/people`) + .then((res) => { + getSavedPeople(res.data); + }) + .catch((res) => { + alert("The promise returned an error idk what to do"); + console.log(res); + }) + } + // get data from server on startup useEffect(() => { getRegisteredItems(); + getRegisteredPeople(); }, []); // TODO: to be handled by backend const defGSTValue = 18; @@ -62,12 +76,15 @@ const BillingPage = () => { {registerPersonFormVisibility && } + +