Changeset 21175ba for client_app/src
- Timestamp:
- 01/15/21 03:52:52 (4 years ago)
- Branches:
- master
- Children:
- 4302312
- Parents:
- 0d7b1a9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client_app/src/components/main/App.js
r0d7b1a9 r21175ba 24 24 import InternshipRegister from "../work_register/internship_register"; 25 25 import ProjectRegister from "../work_register/project_register"; 26 import EditJob from "../work_edit/test"; 26 27 27 28 class App extends Component{ … … 61 62 <Route path={"/register/internship"} render={() => <InternshipRegister accountId={this.state.currentUser.id} type={this.state.currentUser.type} updateInternships={this.updateInternships} />}/> 62 63 <Route path={"/register/project"} render={() => <ProjectRegister accountId={this.state.currentUser.id} type={this.state.currentUser.type} updateProjects={this.updateProjects} />}/> 64 <Route path={"/edit/job"} render={(props) => <EditJob {...props} editJob={this.editJob}/>} /> 65 <Route path={"/edit/internship"} render={(props) => <EditInternship {...props} editJob={this.editInternship}/>} /> 66 <Route path={"/edit/project"} render={(props) => <EditProject {...props} editJob={this.editProject}/>} /> 63 67 <Route path={"/logout"} render={() => <Redirect to={"/login"}/>}/> 64 68 <Route path={"/"} render={() => <Redirect to={"/login"}/>}/> … … 116 120 } 117 121 122 editJob = (job, index) => { 123 this.setState(prevState => ({ 124 currentUser:{ 125 ...prevState.currentUser, 126 jobs: Object.assign([],this.state.jobs,{[index]: job}) 127 } 128 })) 129 } 130 131 editInternship = (internship, index) => { 132 this.setState(prevState => ({ 133 currentUser:{ 134 ...prevState.currentUser, 135 internships: Object.assign([],this.state.jobs,{[index]: internship}) 136 } 137 })) 138 } 139 140 editProject = (project, index) => { 141 this.setState(prevState => ({ 142 currentUser:{ 143 ...prevState.currentUser, 144 projects: Object.assign([],this.state.jobs,{[index]: project}) 145 } 146 })) 147 } 148 118 149 attemptLogin = (email, password, type) => { 119 150 UserLogin.login(email, password, type).then((res) =>{
Note:
See TracChangeset
for help on using the changeset viewer.