Commit 3a3923b2 authored by Ben Anderson's avatar Ben Anderson

Fixed issue in field name

parent 9d1adcd6
......@@ -4,12 +4,12 @@ import { useHistory, useLocation } from "react-router";
const emptyForm = {
sku: "",
upc: "",
productName: "",
prodName: "",
brand: "",
category: "",
price: 0.0,
stock: 0,
productDescription: "",
prodDesc: "",
productImage: "",
};
......@@ -33,7 +33,7 @@ export default function ProductForm(props) {
if (form.upc.length < 3) {
errs.push("UPC must be at least 3 characters");
}
if (form.productName.length === 0) {
if (form.prodName.length === 0) {
errs.push("Please enter a product name");
}
if (form.brand.length === 0) {
......@@ -126,19 +126,17 @@ export default function ProductForm(props) {
<div className="row mt-3">
<div className="col-6">
<div>
<label htmlFor="productName" className="form-label">
<label htmlFor="prodName" className="form-label">
Name
</label>
<input
required
name="productName"
name="prodName"
type="text"
className="form-control"
id="productName"
value={form.productName}
onChange={(e) =>
setForm({ ...form, productName: e.target.value })
}
id="prodName"
value={form.prodName}
onChange={(e) => setForm({ ...form, prodName: e.target.value })}
/>
</div>
<div>
......@@ -171,19 +169,17 @@ export default function ProductForm(props) {
</div>
</div>
<div className="col-6">
<label htmlFor="productDescription" className="form-label">
<label htmlFor="prodDesc" className="form-label">
Description
</label>
<textarea
name="productDescription"
id="productDescription"
name="prodDesc"
id="prodDesc"
cols="40"
rows="7"
className="form-control"
value={form.productDescription}
onChange={(e) =>
setForm({ ...form, productDescription: e.target.value })
}
value={form.prodDesc}
onChange={(e) => setForm({ ...form, prodDesc: e.target.value })}
></textarea>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment