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

{this.state.error}

); } componentDidMount(){ SkillFetch.fetchAll().then((data) =>{ this.setState({ allSkills: 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;