diff options
author | MikunoNaka <bokuwakanojogahoshii@yahoo.com> | 2021-08-08 13:00:16 +0530 |
---|---|---|
committer | MikunoNaka <bokuwakanojogahoshii@yahoo.com> | 2021-08-08 13:00:16 +0530 |
commit | 0f0e5f7408969fcc4473746919bb0e8aaa89947c (patch) | |
tree | 0e5119e9bd8c021aceea9d79a9e5d58040480608 /src/components/Form/Transport | |
parent | 6baad020ce5037a90d902c8f41f1f37f52419a10 (diff) |
half-cleaned the way saving invoices works
Diffstat (limited to 'src/components/Form/Transport')
-rw-r--r-- | src/components/Form/Transport/TransportForm.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/components/Form/Transport/TransportForm.tsx b/src/components/Form/Transport/TransportForm.tsx index 60dfee3..af64d80 100644 --- a/src/components/Form/Transport/TransportForm.tsx +++ b/src/components/Form/Transport/TransportForm.tsx @@ -11,15 +11,17 @@ import { Transport } from "./../../../interfaces" interface Props { setVisibility: Dispatch<SetStateAction<boolean>> // this component's visibility + currentTransporter: Transport setTransporter: Dispatch<SetStateAction<Transport>> } const TransportForm: React.FC<Props> = (props) => { - const [transporterName, setTransporterName] = useState<string>(""); - const [vehicleNum, setVehicleNum] = useState<string>(""); - const [transportMethod, setTransportMethod] = useState<string>(""); - const [transporterGSTIN, setTransporterGSTIN] = useState<string>(""); - const [builtyNumber, setBuiltyNumber] = useState<string>(""); + // read values from already existing transporter + const [transporterName, setTransporterName] = useState<string>(props.currentTransporter.Name); + const [vehicleNum, setVehicleNum] = useState<string>(props.currentTransporter.VehicleNum); + const [transportMethod, setTransportMethod] = useState<string>(props.currentTransporter.Method); + const [transporterGSTIN, setTransporterGSTIN] = useState<string>(props.currentTransporter.GSTIN); + const [builtyNumber, setBuiltyNumber] = useState<string>(props.currentTransporter.Builty); const hideSelf = () => props.setVisibility(false); |