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
7b599b8c
Commit
7b599b8c
authored
May 07, 2021
by
John Lam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new promo form working
parent
5207d84d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
PromotionNewFormComponent.jsx
src/component/promotionforms/PromotionNewFormComponent.jsx
+9
-11
UpdatePromotionForm.jsx
src/component/promotionforms/UpdatePromotionForm.jsx
+0
-0
No files found.
src/component/promotionforms/PromotionNewFormComponent.jsx
View file @
7b599b8c
...
@@ -7,19 +7,17 @@ export default function PromotionNewFormComponent () {
...
@@ -7,19 +7,17 @@ export default function PromotionNewFormComponent () {
const
{
register
,
watch
,
handleSubmit
,
formState
:
{
errors
}
}
=
useForm
();
const
{
register
,
watch
,
handleSubmit
,
formState
:
{
errors
}
}
=
useForm
();
const
onSubmit
=
(
data
)
=>
{
const
onSubmit
=
(
data
)
=>
{
console
.
log
(
data
)
console
.
log
(
data
)
alert
(
JSON
.
stringify
(
data
));
alert
(
JSON
.
stringify
(
data
));
// fetch("localhost:8081/api/promotion", {
fetch
(
"http://localhost:8081/api/promos"
,
{
// method: "POST",
method
:
"POST"
,
// headers: {
headers
:
{
// 'Content-Type': 'application/json',
"Content-Type"
:
"application/json"
,
// },
},
// body: JSON.stringify(data),
body
:
JSON
.
stringify
(
data
),
// })
})
// .then(res => res.json())
.
then
(
res
=>
res
.
json
())
// .then(json => console.log(json))
.
catch
(
err
=>
console
.
log
(
err
.
data
))
// .catch(err => console.log(err.data))
};
};
console
.
log
(
errors
);
console
.
log
(
errors
);
...
...
src/component/promotionforms/UpdatePromotionForm.jsx
0 → 100644
View file @
7b599b8c
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