- Timestamp:
- 01/11/21 18:57:03 (3 years ago)
- Branches:
- master
- Children:
- 8f1f460
- Parents:
- fc8421e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/web/controller/WorkEditController.java
rfc8421e r5f9d25a 25 25 } 26 26 27 @PostMapping("/job/{userId}/{id}") 28 public JobResponseDTO editJob(@PathVariable Long userId, 29 @PathVariable Long id, 27 @PostMapping("/job/{id}") 28 public JobResponseDTO editJob(@PathVariable Long id, 30 29 @RequestBody JobRegisterDTO body){ 31 30 32 if( userId.equals(this.workService.getJobById(id).getAccount().getId())) {31 if(body.getAccountId().equals(this.workService.getJobById(id).getAccount().getId())) { 33 32 Job k = this.workService.editJob(id, body.getTitle(), body.getDescription(), body.getSalary()); 34 35 33 return new JobResponseDTO(k); 36 34 } 37 38 35 return null; 39 36 } 40 37 41 @PostMapping("/internship/{userId}/{id}") 42 public InternshipResponseDTO editInternship(@PathVariable Long userId, 43 @PathVariable Long id, 38 @PostMapping("/internship/{id}") 39 public InternshipResponseDTO editInternship(@PathVariable Long id, 44 40 @RequestBody InternshipRegisterDTO body){ 45 41 46 if( userId.equals(this.workService.getJobById(id).getAccount().getId())){42 if(body.getAccountId().equals(this.workService.getJobById(id).getAccount().getId())){ 47 43 Internship k = this.workService.editInternship(id, body.getTitle(), body.getDescription(), body.getSalary(), body.getOpenSpots()); 48 49 44 return new InternshipResponseDTO(k); 50 45 } 51 52 46 return null; 53 47 } 54 48 55 @PostMapping("/project/{userId}/{id}") 56 public ProjectResponseDTO editProject(@PathVariable Long userId, 57 @PathVariable Long id, 49 @PostMapping("/project/{id}") 50 public ProjectResponseDTO editProject(@PathVariable Long id, 58 51 @RequestBody ProjectRegisterDTO body){ 59 52 60 if( userId.equals(this.workService.getJobById(id).getAccount().getId())) {53 if(body.getAccountId().equals(this.workService.getJobById(id).getAccount().getId())) { 61 54 Project k = this.workService.editProject(id, body.getTitle(), body.getDescription(), body.getSalary()); 62 63 55 return new ProjectResponseDTO(k); 64 56 } 65 66 57 return null; 67 58 }
Note:
See TracChangeset
for help on using the changeset viewer.