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"; ...@@ -4,12 +4,12 @@ import { useHistory, useLocation } from "react-router";
const emptyForm = { const emptyForm = {
sku: "", sku: "",
upc: "", upc: "",
productName: "", prodName: "",
brand: "", brand: "",
category: "", category: "",
price: 0.0, price: 0.0,
stock: 0, stock: 0,
productDescription: "", prodDesc: "",
productImage: "", productImage: "",
}; };
...@@ -33,7 +33,7 @@ export default function ProductForm(props) { ...@@ -33,7 +33,7 @@ export default function ProductForm(props) {
if (form.upc.length < 3) { if (form.upc.length < 3) {
errs.push("UPC must be at least 3 characters"); 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"); errs.push("Please enter a product name");
} }
if (form.brand.length === 0) { if (form.brand.length === 0) {
...@@ -126,19 +126,17 @@ export default function ProductForm(props) { ...@@ -126,19 +126,17 @@ export default function ProductForm(props) {
<div className="row mt-3"> <div className="row mt-3">
<div className="col-6"> <div className="col-6">
<div> <div>
<label htmlFor="productName" className="form-label"> <label htmlFor="prodName" className="form-label">
Name Name
</label> </label>
<input <input
required required
name="productName" name="prodName"
type="text" type="text"
className="form-control" className="form-control"
id="productName" id="prodName"
value={form.productName} value={form.prodName}
onChange={(e) => onChange={(e) => setForm({ ...form, prodName: e.target.value })}
setForm({ ...form, productName: e.target.value })
}
/> />
</div> </div>
<div> <div>
...@@ -171,19 +169,17 @@ export default function ProductForm(props) { ...@@ -171,19 +169,17 @@ export default function ProductForm(props) {
</div> </div>
</div> </div>
<div className="col-6"> <div className="col-6">
<label htmlFor="productDescription" className="form-label"> <label htmlFor="prodDesc" className="form-label">
Description Description
</label> </label>
<textarea <textarea
name="productDescription" name="prodDesc"
id="productDescription" id="prodDesc"
cols="40" cols="40"
rows="7" rows="7"
className="form-control" className="form-control"
value={form.productDescription} value={form.prodDesc}
onChange={(e) => onChange={(e) => setForm({ ...form, prodDesc: e.target.value })}
setForm({ ...form, productDescription: e.target.value })
}
></textarea> ></textarea>
</div> </div>
</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