-
Notifications
You must be signed in to change notification settings - Fork 29.3k
Owner controller #2355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Owner controller #2355
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,12 +77,12 @@ public String initCreationForm() { | |
| @PostMapping("/owners/new") | ||
| public String processCreationForm(@Valid Owner owner, BindingResult result, RedirectAttributes redirectAttributes) { | ||
| if (result.hasErrors()) { | ||
| redirectAttributes.addFlashAttribute("error", "There was an error in creating the owner."); | ||
| redirectAttributes.addFlashAttribute("error", "Errorcreating the owner."); | ||
| return VIEWS_OWNER_CREATE_OR_UPDATE_FORM; | ||
| } | ||
|
|
||
| this.owners.save(owner); | ||
| redirectAttributes.addFlashAttribute("message", "New Owner Created"); | ||
| redirectAttributes.addFlashAttribute("message", "Owner Created Successfully"); | ||
| return "redirect:/owners/" + owner.getId(); | ||
|
Comment on lines
77
to
86
|
||
| } | ||
|
|
||
|
|
@@ -142,7 +142,7 @@ public String initUpdateOwnerForm() { | |
| public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result, @PathVariable("ownerId") int ownerId, | ||
| RedirectAttributes redirectAttributes) { | ||
| if (result.hasErrors()) { | ||
| redirectAttributes.addFlashAttribute("error", "There was an error in updating the owner."); | ||
| redirectAttributes.addFlashAttribute("error", "Error updating the owner."); | ||
| return VIEWS_OWNER_CREATE_OR_UPDATE_FORM; | ||
| } | ||
|
|
||
|
|
@@ -154,7 +154,7 @@ public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result, @ | |
|
|
||
| owner.setId(ownerId); | ||
| this.owners.save(owner); | ||
| redirectAttributes.addFlashAttribute("message", "Owner Values Updated"); | ||
| redirectAttributes.addFlashAttribute("message", "Owner Values Updated Successfully"); | ||
| return "redirect:/owners/{ownerId}"; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,5 +11,10 @@ | |||||
| |___| |_______| |___| |_______|_______|___|_| |__|___|_______| / / / / | ||||||
| ==================================================================/_/_/_/ | ||||||
|
|
||||||
| Welcome to Pet Clinic | ||||||
|
|
||||||
| Spring Petclinic is a Spring Boot application built using Maven or Gradle. | ||||||
|
||||||
| Spring Petclinic is a Spring Boot application built using Maven or Gradle. | |
| Spring Petclinic is a Spring Boot application built using Maven or Gradle. |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,26 +19,26 @@ $spring-green: #6db33f; | |||||||
| $spring-dark-green: #5fa134; | ||||||||
| $spring-brown: #34302D; | ||||||||
| $spring-grey: #838789; | ||||||||
| $spring-light-grey: #f1f1f1; | ||||||||
| $spring-white: #ffffff; | ||||||||
|
||||||||
| $spring-white: #ffffff; | |
| $spring-white: #ffffff; | |
| $spring-light-grey: $spring-white; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flash error message has a typo (missing space) and reads awkwardly. Please fix the text so it’s readable for end users.