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
578f01a2
Commit
578f01a2
authored
May 13, 2021
by
Ben Anderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed fetch link for update product form
parent
3da96b89
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
deployment.yaml
deployment.yaml
+1
-1
ProductForm.jsx
src/component/ProductForm.jsx
+6
-4
No files found.
deployment.yaml
View file @
578f01a2
...
...
@@ -14,7 +14,7 @@ spec:
spec
:
containers
:
-
name
:
afp-inventory-ui-container
image
:
nexus.mynisum.com/afp-inventory-ui:
6
image
:
nexus.mynisum.com/afp-inventory-ui:
7
imagePullPolicy
:
Always
ports
:
-
containerPort
:
8081
...
...
src/component/ProductForm.jsx
View file @
578f01a2
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
{
useHistory
,
useParams
}
from
"react-router"
;
import
emptyProduct
from
"../emptProduct"
;
import
Config
from
'../config'
;
import
Config
from
"../config"
;
const
emptyForm
=
{
...
emptyProduct
,
...
...
@@ -21,7 +21,7 @@ export default function ProductForm(props) {
const
{
productId
}
=
useParams
(
"productId"
);
useEffect
(()
=>
{
fetch
(
`
http://localhost:8080/api/products/
${
productId
}
/`
).
then
((
res
)
=>
{
fetch
(
`
${
Config
.
inventoryUrl
}
${
productId
}
/`
).
then
((
res
)
=>
{
if
(
res
.
ok
)
{
console
.
log
(
res
);
res
.
json
().
then
((
data
)
=>
{
...
...
@@ -40,7 +40,7 @@ export default function ProductForm(props) {
const
validate
=
()
=>
{
setErrors
([]);
const
errs
=
[];
console
.
log
(
form
)
console
.
log
(
form
)
;
if
(
form
.
sku
.
length
<
3
)
{
errs
.
push
(
"SKU must be at least 3 characters"
);
}
...
...
@@ -238,7 +238,9 @@ export default function ProductForm(props) {
className=
"form-control"
id=
"stock"
value=
{
form
.
availableStock
}
onChange=
{
(
e
)
=>
setForm
({
...
form
,
availableStock
:
e
.
target
.
value
})
}
onChange=
{
(
e
)
=>
setForm
({
...
form
,
availableStock
:
e
.
target
.
value
})
}
/>
</
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