|
@@ -1,10 +1,28 @@
|
|
|
import React from 'react'
|
|
|
import { Field, reduxForm } from 'redux-form'
|
|
|
|
|
|
+const axios = require('axios');
|
|
|
+const submit = values => {
|
|
|
+ axios.post(`http://127.0.0.1:2000/api/users`,{
|
|
|
+ "name": values.Name,
|
|
|
+ "description": "dfgfdhd",
|
|
|
+ "login": "Johny",
|
|
|
+ "password": values.Login,
|
|
|
+ "isAdmin": "0",
|
|
|
+ "email": values.email,
|
|
|
+ "avatar": "https://git-scm.com/book/ru/v1/",
|
|
|
+ "phone": values.Phone
|
|
|
+})
|
|
|
+ .then(function (response) {
|
|
|
+ // handle success
|
|
|
+ console.log(response);
|
|
|
+ })
|
|
|
+ .catch((err)=>console.log(err))
|
|
|
+};
|
|
|
const RegistrForm = props => {
|
|
|
const { handleSubmit, pristine, reset, submitting } = props
|
|
|
return (
|
|
|
- <form onSubmit={handleSubmit}>
|
|
|
+ <form onSubmit={handleSubmit(submit)}>
|
|
|
<div>
|
|
|
<label>Login</label>
|
|
|
<div>
|