Guest User

Untitled

a guest
Sep 24th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. const data = {
  2. email: 'val1',
  3. password: 'val2'
  4. }
  5. const headers = {
  6. 'Authorization': 'Bearer ' + token,
  7. 'Accept': 'application/json',
  8. 'Content-Type': 'application/x-www-form-urlencoded',
  9.  
  10. }
  11. axios.put('/api/edit', data, {headers: headers})
  12.  
  13. .then(response => {
  14. dispatch({
  15. type: EDIT_SUCCESS,
  16. payload: response,
  17. }, console.log(response.data));
  18. })
  19.  
  20. public function edit(Request $request)
  21. {
  22. $user = Auth::user();
  23.  
  24. $input = $request->all();
  25.  
  26. return response()->json(['success'=>$user, 'input'=> $input ], $this-> successStatus);
  27. }
Add Comment
Please, Sign In to add comment