import React from 'react'; import 'semantic-ui-react'; import {Button, Container, Form} from "semantic-ui-react"; import { Redirect } from 'react-router-dom'; import SkillFetch from "../../repository/skill_repo"; import UserRegister from "../../repository/register_repo"; import {Component} from "react/cjs/react.production.min"; class RegisterUser extends Component { constructor(props) { super(props); this.state = { email: "", password: "", type: "0", name: "", surname: "", retainedSkills: [], skillsToLearn: [], allSkills: [], error: props.error } } handleCheck = (e, {value}) => { this.setState({ ...this.state, [e.target.name]: value }) } render() { return (

{this.state.error}

); } componentDidMount(){ SkillFetch.fetchAll().then((data) =>{ this.setState({ allSkills: data.data }) }) } attemptRegister(){ UserRegister.userRegister( this.state.email, this.state.password, this.state.name, this.state.surname, this.state.retainedSkills, this.state.skillsToLearn ).then(data => { if(data.success){ return }else{ return } }) } } export default RegisterUser;