Skip to content

Commit

Permalink
Same))0)0
Browse files Browse the repository at this point in the history
  • Loading branch information
ImLewel committed Dec 21, 2023
1 parent a87239e commit c3f4579
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ paths:
'application/json':
schema:
$ref: "#/components/schemas/Vacancy"
"404":
description: "Not Found"
"400":
description: "Bad Request"
content:
'application/text':
schema:
type: "string"
example: "Wrong path variable"
example: "Wrong data provided"
"409":
description: "Conflict"
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class CompanyRestControllerImpl(@Autowired private val service: GeneralService)
vacancy: Vacancy,
@PathVariable("company") company: String,
): ResponseEntity<Int> {
return ResponseEntity.ok(service.createVacancy(vacancy))
if (vacancy.description == null || vacancy.requirements == null || vacancy.title == null)
return ResponseEntity.badRequest().build()
else return ResponseEntity.ok(service.createVacancy(vacancy))
}

@PutMapping("/upgrade/{id}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class CompanyControllerImpl(private val generalService: GeneralService) {

@GetMapping("/")
fun getCompanyVacancies(@PathVariable("company") company: String): ModelAndView {
val vacancies = generalService.getCompanyVacancies(company)
val mav = ModelAndView("company")
mav.addObject("vacancies", vacancies)
return mav
val vacancies = generalService.getCompanyVacancies(company)
val mav = ModelAndView("company")
mav.addObject("vacancies", vacancies)
return mav
}

@PostMapping("/create")
Expand Down

0 comments on commit c3f4579

Please sign in to comment.