Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Book-Management-System
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ashwanth K
Book-Management-System
Commits
521fb1a5
Commit
521fb1a5
authored
4 years ago
by
Ashwanth K
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
3f9681c0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/src/Components/Forms/update_user.jsx
+60
-0
60 additions, 0 deletions
client/src/Components/Forms/update_user.jsx
with
60 additions
and
0 deletions
client/src/Components/Forms/update_user.jsx
0 → 100644
+
60
−
0
View file @
521fb1a5
import
React
,
{
Component
}
from
'
react
'
import
'
./forms.css
'
import
axios
from
'
axios
'
;
export
default
class
Uupdate
extends
Component
{
constructor
(
props
){
super
(
props
);
this
.
state
=
{
User_id
:
''
,
name
:
''
,
Email
:
''
,
Password
:
''
,
}
this
.
handleChange
=
this
.
handleChange
.
bind
(
this
);
this
.
update
=
this
.
update
.
bind
(
this
);
}
handleChange
(
event
)
{
this
.
setState
({
[
event
.
target
.
name
]:
event
.
target
.
value
});
}
update
(
event
){
const
user
=
{
user_id
:
this
.
state
.
User_id
,
name
:
this
.
state
.
name
,
email
:
this
.
state
.
Email
,
password
:
this
.
state
.
Password
,
}
axios
.
post
(
'
http://localhost:5000/user/update/
'
+
this
.
state
.
User_id
,
user
)
.
then
(
window
.
alert
(
"
User Updated successfully!
"
))
.
catch
(
console
.
error
())
event
.
preventDefault
();
}
render
(){
return
(
<
div
>
<
h3
style
=
{
{
fontFamily
:
"
Roboto
"
,
marginLeft
:
"
20px
"
}
}
>
<
b
>
USER UPDATION
</
b
>
</
h3
>
<
form
>
<
ul
style
=
{
{
listStyle
:
"
none
"
}
}
>
<
li
><
div
>
<
input
type
=
"text"
placeholder
=
"User_id"
name
=
"User_id"
onChange
=
{
this
.
handleChange
}
required
/>
<
input
type
=
"text"
placeholder
=
"User_Name"
name
=
"name"
onChange
=
{
this
.
handleChange
}
required
/>
</
div
></
li
>
<
li
><
div
>
<
input
type
=
"text"
placeholder
=
"Email"
name
=
"Email"
onChange
=
{
this
.
handleChange
}
required
/>
<
input
type
=
"text"
placeholder
=
"Password"
name
=
"Password"
onChange
=
{
this
.
handleChange
}
required
/>
</
div
></
li
>
<
li
><
div
>
<
input
type
=
"submit"
value
=
"Update"
onClick
=
{
this
.
update
}
/></
div
></
li
>
</
ul
>
</
form
>
</
div
>
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment