Changeset 5b36317


Ignore:
Timestamp:
01/14/21 23:04:01 (3 years ago)
Author:
Vzdra <vladko.zdravkovski@…>
Branches:
master
Children:
0d7b1a9
Parents:
db94dbd
Message:

completed work registration

Location:
client_app/src/components
Files:
3 edited

Legend:

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

    rdb94dbd r5b36317  
    6060                      <Route path={"/register/job"} render={() => <JobRegister accountId={this.state.currentUser.id} type={this.state.currentUser.type} updateJobs={this.updateJobs} />}/>
    6161                      <Route path={"/register/internship"} render={() => <InternshipRegister accountId={this.state.currentUser.id} type={this.state.currentUser.type} updateInternships={this.updateInternships} />}/>
    62                       <Route path={"/register/project"} render={() => <ProjectRegister accountId={this.state.currentUser.id} type={this.state.currentUser.type} updateInternships={this.updateProjects} />}/>
     62                      <Route path={"/register/project"} render={() => <ProjectRegister accountId={this.state.currentUser.id} type={this.state.currentUser.type} updateProjects={this.updateProjects} />}/>
    6363                      <Route path={"/logout"} render={() => <Redirect to={"/login"}/>}/>
    6464                      <Route path={"/"} render={() => <Redirect to={"/login"}/>}/>
  • client_app/src/components/work_register/internship_register.js

    rdb94dbd r5b36317  
    6868        }
    6969
    70         if(this.state.success===true){
    71             if(this.state.type==="COMPANY"){
    72                 return(
    73                     <Redirect to={"/company/internships"}/>
    74                 );
    75             }else{
    76                 return(
    77                     <Redirect to={"/profile"}/>
    78                 );
    79             }
     70        if(this.state.success===true) {
     71            return (
     72                <Redirect to={"/company/internships"}/>
     73            );
    8074        }
    8175
  • client_app/src/components/work_register/project_register.js

    rdb94dbd r5b36317  
    5454            this.state.skillsRequired
    5555        ).then(res => {
    56             console.log(res);
    57             // this.props.updateProjects(res.data);
    58             // this.setState({
    59             //     success: true,
    60             //     error: null
    61             // })
     56            this.props.updateProjects(res.data);
     57            this.setState({
     58                success: true,
     59                error: null
     60            })
    6261        }).catch(err => {
    6362            console.log(err);
     
    7776
    7877        if(this.state.success===true){
    79             if(this.state.type==="TEAM"){
    80                 return(
    81                     <Redirect to={"/company/jobs"}/>
    82                 );
    83             }else{
    84                 return(
    85                     <Redirect to={"/team/jobs"}/>
    86                 );
    87             }
     78            return (
     79                <Redirect to={"/team/projects"}/>
     80            );
    8881        }
    8982
Note: See TracChangeset for help on using the changeset viewer.