From 521fb1a5d16f8486b52b4e23fbb7b944dbbc8215 Mon Sep 17 00:00:00 2001
From: Ashwanth K <cb.en.u4cse19305@cb.students.amrita.edu>
Date: Sun, 27 Dec 2020 20:26:14 +0530
Subject: [PATCH] Upload New File

---
 client/src/Components/Forms/update_user.jsx | 60 +++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 client/src/Components/Forms/update_user.jsx

diff --git a/client/src/Components/Forms/update_user.jsx b/client/src/Components/Forms/update_user.jsx
new file mode 100644
index 0000000..a30b64c
--- /dev/null
+++ b/client/src/Components/Forms/update_user.jsx
@@ -0,0 +1,60 @@
+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/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
+         <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/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
+         <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
-- 
GitLab