mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-04-29 05:32:48 +00:00
Update OwnerController.java
This commit is contained in:
parent
14af47d4e5
commit
216a44cc06
1 changed files with 0 additions and 11 deletions
|
@ -62,11 +62,6 @@ class OwnerController {
|
||||||
return ownerId == null ? new Owner() : this.owners.findById(ownerId);
|
return ownerId == null ? new Owner() : this.owners.findById(ownerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/owners/new")
|
|
||||||
public String initCreationForm() {
|
|
||||||
return VIEWS_OWNER_CREATE_OR_UPDATE_FORM;
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/owners/new")
|
@PostMapping("/owners/new")
|
||||||
public String processCreationForm(@Valid Owner owner, BindingResult result, RedirectAttributes redirectAttributes) {
|
public String processCreationForm(@Valid Owner owner, BindingResult result, RedirectAttributes redirectAttributes) {
|
||||||
if (result.hasErrors()) {
|
if (result.hasErrors()) {
|
||||||
|
@ -119,12 +114,6 @@ class OwnerController {
|
||||||
return "owners/ownersList";
|
return "owners/ownersList";
|
||||||
}
|
}
|
||||||
|
|
||||||
private Page<Owner> findPaginatedForOwnersLastName(int page, String lastname) {
|
|
||||||
int pageSize = 5;
|
|
||||||
Pageable pageable = PageRequest.of(page - 1, pageSize);
|
|
||||||
return owners.findByLastName(lastname, pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/owners/{ownerId}/edit")
|
@GetMapping("/owners/{ownerId}/edit")
|
||||||
public String initUpdateOwnerForm() {
|
public String initUpdateOwnerForm() {
|
||||||
return VIEWS_OWNER_CREATE_OR_UPDATE_FORM;
|
return VIEWS_OWNER_CREATE_OR_UPDATE_FORM;
|
||||||
|
|
Loading…
Reference in a new issue