Ignore:
Timestamp:
01/14/21 02:31:15 (4 years ago)
Author:
Vzdra <vladko.zdravkovski@…>
Branches:
master
Children:
be373a8
Parents:
df3a395
Message:

register and edit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • client_app/src/components/main/App.js

    rdf3a395 r580ba1a  
    1717import RegisterCompany from "../register/register_company_form";
    1818import RegisterTeam from "../register/register_team_form";
     19import Search from "../filter/search";
     20import EditUser from "../account_edit/user_edit";
     21import EditCompany from "../account_edit/company_edit";
    1922
    2023class App extends Component{
     
    3033  }
    3134
    32   render(){
     35    render(){
    3336          return(
    3437              <Router>
     
    4750                      <Route path={"/register/company"} render={() => <RegisterCompany message={this.setSuccess} />}/>
    4851                      <Route path={"/register/team"} render={() => <RegisterTeam message={this.setSuccess}/>}/>
     52                      <Route path={"/user/search"} render={() => <Search loggedIn={this.state.logged}/>}/>
     53                      <Route path={"/user/edit"} render={() => <EditUser oldUser={this.state.currentUser} updateUser={this.updateUser} message={this.setSuccess}/>}/>
     54                      <Route path={"/company/edit"} render={() => <EditCompany oldUser={this.state.currentUser} updateUser={this.updateUser} message={this.setSuccess}/>}/>
    4955                      <Route path={"/logout"} render={() => <Redirect to={"/login"}/>}/>
    5056                      <Route path={"/"} render={() => <Redirect to={"/login"}/>}/>
     
    6268  }
    6369
     70  updateUser = (user) =>{
     71      this.setState({
     72          currentUser: user
     73      })
     74  }
     75
    6476  setSuccess = (message) => {
    6577      this.setState({
     
    7082  attemptLogin = (email, password, type) => {
    7183      UserLogin.login(email, password, type).then((res) =>{
    72           console.log(res.data);
    7384          if(res.data.email==null){
    7485              this.setState({
Note: See TracChangeset for help on using the changeset viewer.