Changeset df3a395
- Timestamp:
- 01/13/21 17:24:58 (4 years ago)
- Branches:
- master
- Children:
- 580ba1a
- Parents:
- 7944fab
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
client_app/src/components/main/App.js
r7944fab rdf3a395 14 14 import TeamJobs from "../work/team_jobs"; 15 15 import CompanyInternships from "../work/company_internships"; 16 import UserRegister from "../../repository/register_repo";17 16 import RegisterUser from "../register/register_user_form"; 17 import RegisterCompany from "../register/register_company_form"; 18 import RegisterTeam from "../register/register_team_form"; 18 19 19 20 class App extends Component{ … … 23 24 logged: false, 24 25 error: null, 26 success: null, 25 27 currentUser: { 26 28 } … … 33 35 <HeaderComp acc={this.state.currentUser.email} accType={this.state.currentUser.type} name={this.state.currentUser.name} removeState={this.removeState}/> 34 36 <main> 35 <Route path={"/login"} render={() => <Login error={this.state.error} onCompleteForm={this.attemptLogin} loggedIn={this.state.logged}/>}/>37 <Route path={"/login"} render={() => <Login success={this.state.success} error={this.state.error} onCompleteForm={this.attemptLogin} loggedIn={this.state.logged}/>}/> 36 38 <Route path={"/profile"} render={() => <Profile userProfile={this.state.currentUser}/>}/> 37 39 <Route path={"/user/jobs"} render={() => <UserJobs userProfile={this.state.currentUser}/>}/> … … 42 44 <Route path={"/company/jobs"} render={() => <CompanyJobs userProfile={this.state.currentUser}/>}/> 43 45 <Route path={"/company/internships"} render={() => <CompanyInternships userProfile={this.state.currentUser}/>}/> 44 <Route path={"/register/user"} render={() => <RegisterUser error={null} success={null}/>}/> 46 <Route path={"/register/user"} render={() => <RegisterUser message={this.setSuccess} />}/> 47 <Route path={"/register/company"} render={() => <RegisterCompany message={this.setSuccess} />}/> 48 <Route path={"/register/team"} render={() => <RegisterTeam message={this.setSuccess}/>}/> 45 49 <Route path={"/logout"} render={() => <Redirect to={"/login"}/>}/> 46 50 <Route path={"/"} render={() => <Redirect to={"/login"}/>}/> … … 58 62 } 59 63 64 setSuccess = (message) => { 65 this.setState({ 66 success: message 67 }) 68 } 60 69 61 70 attemptLogin = (email, password, type) => { -
client_app/src/components/register/register_user_form.js
r7944fab rdf3a395 6 6 import UserRegister from "../../repository/register_repo"; 7 7 import {Component} from "react/cjs/react.production.min"; 8 import Login from "../login/login"; 8 9 9 10 class RegisterUser extends Component { … … 18 19 retainedSkills: [], 19 20 skillsToLearn: [], 20 error: props.error,21 success: props.success,21 error: null, 22 success: null, 22 23 sortedOptions:[] 23 24 } … … 58 59 error: null 59 60 }) 61 62 this.props.message(this.state.success); 60 63 }else{ 61 64 this.setState({ … … 73 76 74 77 render() { 75 console.log(this.state.success);76 77 78 if(this.state.success!=null){ 78 79 return( 79 <Redirect to={"/login"} success={this.state.success}/>80 <Redirect to={"/login"}/> 80 81 ); 81 82 } … … 106 107 107 108 componentDidMount(){ 109 this.props.message(null); 110 108 111 SkillFetch.fetchAll().then((data) =>{ 109 112 var sorted = []; -
client_app/src/repository/register_repo.js
r7944fab rdf3a395 12 12 }); 13 13 }, 14 teamRegister: (email, password, name, members) => {14 teamRegister: (email, password, name, members) => { 15 15 return axios.post("/register/team",{ 16 16 "email": email, … … 20 20 }); 21 21 }, 22 companyRegister: (email, password, name, country, city, street) => {22 companyRegister: (email, password, name, country, city, street) => { 23 23 return axios.post("/register/company",{ 24 24 "email": email, -
src/main/java/it/finki/tinki/service/impl/AccountServiceImpl.java
r7944fab rdf3a395 106 106 } 107 107 108 System.out.println(email); 109 108 110 if(this.companyRepository.findByEmail(email).isPresent()){ 109 111 throw new UserExistsException();
Note:
See TracChangeset
for help on using the changeset viewer.