Changeset 6729ba5 for client_app/src/components/main
- Timestamp:
- 01/15/21 16:39:45 (4 years ago)
- Branches:
- master
- Children:
- 81c9e25
- Parents:
- ed3f5c4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client_app/src/components/main/App.js
red3f5c4 r6729ba5 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 import EditJob from "../work_edit/edit_job"; 27 import EditInternship from "../work_edit/edit_internship"; 28 import EditProject from "../work_edit/edit_project"; 27 29 28 30 class App extends Component{ … … 63 65 <Route path={"/register/project"} render={() => <ProjectRegister accountId={this.state.currentUser.id} type={this.state.currentUser.type} updateProjects={this.updateProjects} />}/> 64 66 <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}/>} />*/}67 <Route path={"/edit/internship"} render={(props) => <EditInternship {...props} editInternship={this.editInternship}/>} /> 68 <Route path={"/edit/project"} render={(props) => <EditProject {...props} editProject={this.editProject}/>} /> 67 69 <Route path={"/logout"} render={() => <Redirect to={"/login"}/>}/> 68 70 <Route path={"/"} render={() => <Redirect to={"/login"}/>}/> … … 121 123 122 124 editJob = (job, index) => { 125 let jobs = this.state.currentUser.jobs; 126 jobs[index] = job; 127 123 128 this.setState(prevState => ({ 124 129 currentUser:{ 125 130 ...prevState.currentUser, 126 jobs: Object.assign([],this.state.jobs,{[index]: job})131 jobs: jobs 127 132 } 128 133 })) … … 130 135 131 136 editInternship = (internship, index) => { 137 let interns = this.state.currentUser.internships; 138 interns[index] = internship; 139 132 140 this.setState(prevState => ({ 133 141 currentUser:{ 134 142 ...prevState.currentUser, 135 internships: Object.assign([],this.state.jobs,{[index]: internship})143 internships: interns 136 144 } 137 145 })) … … 139 147 140 148 editProject = (project, index) => { 149 let proj = this.state.currentUser.projects; 150 proj[index] = project; 151 141 152 this.setState(prevState => ({ 142 153 currentUser:{ 143 154 ...prevState.currentUser, 144 projects: Object.assign([],this.state.jobs,{[index]: project})155 projects: proj 145 156 } 146 157 }))
Note:
See TracChangeset
for help on using the changeset viewer.