diff --git a/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java b/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java index e9cba805c..7024631ca 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java +++ b/src/main/java/org/springframework/samples/petclinic/web/OwnerResource.java @@ -64,9 +64,8 @@ public class OwnerResource { */ @RequestMapping(value = "/owner", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) - public void createOwner(@RequestBody Owner owner) { + public void createOwner(@Valid @RequestBody Owner owner) { this.clinicService.saveOwner(owner); - // TODO: need to handle failure } /** diff --git a/src/main/webapp/scripts/app/owner/ownerForm.html b/src/main/webapp/scripts/app/owner/ownerForm.html index 719c0af24..38177f549 100644 --- a/src/main/webapp/scripts/app/owner/ownerForm.html +++ b/src/main/webapp/scripts/app/owner/ownerForm.html @@ -1,37 +1,45 @@
-

Owner

-
-
- - +
+ +
+ First name is required.
-
- - +
+
+ +
+ Last name is required.
-
- - +
+
+ +
+ Address is required.
-
- - +
+
+ +
+ City is required.
-
- - +
+
+ +
+ Telephone is required.
- -
- -
-
+
+
+
+ +
+
diff --git a/src/main/webapp/scripts/app/owner/ownerSearchForm.html b/src/main/webapp/scripts/app/owner/ownerSearchForm.html index 548c452a8..4cd2fac2d 100644 --- a/src/main/webapp/scripts/app/owner/ownerSearchForm.html +++ b/src/main/webapp/scripts/app/owner/ownerSearchForm.html @@ -1,15 +1,9 @@ -

Find Owners

-
-
-
- - -
-
- -
-
-
- -
- Add Owners +

Owners

+
+
+ + + | + Add New Owner +
+
\ No newline at end of file