Changeset db94dbd for client_app/src/components/main
- Timestamp:
- 01/14/21 22:54:45 (4 years ago)
- Branches:
- master
- Children:
- 5b36317
- Parents:
- be373a8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client_app/src/components/main/App.js
rbe373a8 rdb94dbd 21 21 import EditCompany from "../account_edit/company_edit"; 22 22 import EditTeam from "../account_edit/team_edit"; 23 import JobRegister from "../work_register/job_register"; 24 import InternshipRegister from "../work_register/internship_register"; 25 import ProjectRegister from "../work_register/project_register"; 23 26 24 27 class App extends Component{ … … 55 58 <Route path={"/company/edit"} render={() => <EditCompany oldUser={this.state.currentUser} updateUser={this.updateUser} message={this.setSuccess}/>}/> 56 59 <Route path={"/team/edit"} render={() => <EditTeam oldUser={this.state.currentUser} updateUser={this.updateUser} message={this.setSuccess}/>}/> 60 <Route path={"/register/job"} render={() => <JobRegister accountId={this.state.currentUser.id} type={this.state.currentUser.type} updateJobs={this.updateJobs} />}/> 61 <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} />}/> 57 63 <Route path={"/logout"} render={() => <Redirect to={"/login"}/>}/> 58 64 <Route path={"/"} render={() => <Redirect to={"/login"}/>}/> … … 83 89 } 84 90 91 updateJobs = (job) => { 92 this.setState(prevState => ({ 93 currentUser:{ 94 ...prevState.currentUser, 95 jobs: [...prevState.currentUser.jobs, job] 96 } 97 })) 98 } 99 100 updateInternships = (internship) => { 101 this.setState(prevState => ({ 102 currentUser:{ 103 ...prevState.currentUser, 104 internships: [...prevState.currentUser.internships, internship] 105 } 106 })) 107 } 108 109 updateProjects = (project) => { 110 this.setState(prevState => ({ 111 currentUser:{ 112 ...prevState.currentUser, 113 projects: [...prevState.currentUser.projects, project] 114 } 115 })) 116 } 117 85 118 attemptLogin = (email, password, type) => { 86 119 UserLogin.login(email, password, type).then((res) =>{
Note:
See TracChangeset
for help on using the changeset viewer.