|
@@ -1,10 +1,28 @@
|
|
import React from 'react'
|
|
import React from 'react'
|
|
import { Field, reduxForm } from 'redux-form'
|
|
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 RegistrForm = props => {
|
|
const { handleSubmit, pristine, reset, submitting } = props
|
|
const { handleSubmit, pristine, reset, submitting } = props
|
|
return (
|
|
return (
|
|
- <form onSubmit={handleSubmit}>
|
|
|
|
|
|
+ <form onSubmit={handleSubmit(submit)}>
|
|
<div>
|
|
<div>
|
|
<label>Login</label>
|
|
<label>Login</label>
|
|
<div>
|
|
<div>
|