From 499c54e8eb53cf49d8ddae68528eb3a8243101d2 Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Wed, 5 May 2021 10:20:41 +0530 Subject: fixed broken API routes and css glitch in form --- src/components/BillingPage.js | 4 ++-- src/components/Form/Form.scss | 4 ++-- src/components/Form/Items/AddNewItemForm.js | 9 ++++----- src/components/Form/Items/RegisterItemForm.js | 6 +++--- src/components/Form/People/RegisterPersonForm.js | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/components/BillingPage.js b/src/components/BillingPage.js index 73778a1..71d7c81 100644 --- a/src/components/BillingPage.js +++ b/src/components/BillingPage.js @@ -27,7 +27,7 @@ const BillingPage = () => { const [registerPersonFormVisibility, setRegisterPersonFormVisibility] = useState(false); const getRegisteredItems = () => { - axios.get(`/api/items`) + axios.get(`/api/items/get-all`) .then((res) => { getSavedItems(res.data); }) @@ -38,7 +38,7 @@ const BillingPage = () => { } const getRegisteredPeople = () => { - axios.get(`/api/people`) + axios.get(`/api/people/get-all`) .then((res) => { getSavedPeople(res.data); }) diff --git a/src/components/Form/Form.scss b/src/components/Form/Form.scss index b4490a1..1ba5b85 100644 --- a/src/components/Form/Form.scss +++ b/src/components/Form/Form.scss @@ -72,7 +72,7 @@ input { width: 100%; } -.threePaneForm div { +.threePaneForm .formPane { @include formPane(); } @@ -95,7 +95,7 @@ input { width: 100%; } -.twoPaneForm div { +.twoPaneForm .formPane { @include formPane(); } diff --git a/src/components/Form/Items/AddNewItemForm.js b/src/components/Form/Items/AddNewItemForm.js index 78d1437..b2099e7 100644 --- a/src/components/Form/Items/AddNewItemForm.js +++ b/src/components/Form/Items/AddNewItemForm.js @@ -9,7 +9,6 @@ import React, { useState } from "react"; import "./../Form.scss"; - const AddNewItemForm = (props) => { const [itemNameValue, setItemNameValue] = useState(""); const [itemDescValue, setItemDescValue] = useState(""); @@ -83,7 +82,7 @@ const AddNewItemForm = (props) => { resetAllValues(); } }> -
+
- +
-
+
-
+
props.registerPersonFormVisibility(true)} diff --git a/src/components/Form/Items/RegisterItemForm.js b/src/components/Form/Items/RegisterItemForm.js index 140de29..b57db9f 100644 --- a/src/components/Form/Items/RegisterItemForm.js +++ b/src/components/Form/Items/RegisterItemForm.js @@ -35,7 +35,7 @@ const RegisterItemForm = (props) => { // TODO: show confirmation before being invisible axios.post( - `/api/items/` + `/api/items/register/` + `?model=${newItemNameValue}` + `&desc=${newItemDescValue}` + `&price=${newItemPriceValue}` @@ -59,7 +59,7 @@ const RegisterItemForm = (props) => {
-
+
-
+