Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
inventory-promotion-react
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ascend
inventory-promotion-react
Commits
3a3923b2
Commit
3a3923b2
authored
May 06, 2021
by
Ben Anderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue in field name
parent
9d1adcd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
ProductForm.jsx
src/component/ProductForm.jsx
+13
-17
No files found.
src/component/ProductForm.jsx
View file @
3a3923b2
...
@@ -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
:
""
,
prod
uct
Name
:
""
,
prodName
:
""
,
brand
:
""
,
brand
:
""
,
category
:
""
,
category
:
""
,
price
:
0.0
,
price
:
0.0
,
stock
:
0
,
stock
:
0
,
prod
uctDescription
:
""
,
prod
Desc
:
""
,
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
.
prod
uct
Name
.
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=
"prod
uct
Name"
className=
"form-label"
>
<
label
htmlFor=
"prodName"
className=
"form-label"
>
Name
Name
</
label
>
</
label
>
<
input
<
input
required
required
name=
"prod
uct
Name"
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=
"prod
uctDescription
"
className=
"form-label"
>
<
label
htmlFor=
"prod
Desc
"
className=
"form-label"
>
Description
Description
</
label
>
</
label
>
<
textarea
<
textarea
name=
"prod
uctDescription
"
name=
"prod
Desc
"
id=
"prod
uctDescription
"
id=
"prod
Desc
"
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
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment