Commit b851bc66 authored by miferreiro's avatar miferreiro

Improved control of adding a pet to a person's pet list

- It has been added to restart the form after deleting a row.
- Permits have been introduced to the rest resources
parent fc8d2406
......@@ -41,6 +41,21 @@
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Admin Area</web-resource-name>
<url-pattern>/rest/pets/*</url-pattern>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>OPTIONS</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>ADMIN</role-name>
</auth-constraint>
</security-constraint>
<!-- Security roles referenced by this web application -->
<security-role>
<role-name>ADMIN</role-name>
......
......@@ -101,6 +101,7 @@ var PeopleView = (function() {
dao.deletePerson(id,
function() {
$('tr#person-' + id).remove();
self.resetForm();
},
showErrorMessage
);
......
......@@ -92,6 +92,9 @@ var PetsView = (function() {
function(pet) {
appendToTable(pet);
self.resetForm();
if(pet.idOwner != id) {
$('tr#pet-' + pet.id).remove();
}
},
showErrorMessage,
self.enableForm
......@@ -150,6 +153,7 @@ var PetsView = (function() {
dao.deletePet(id,
function() {
$('tr#pet-' + id).remove();
self.resetForm();
},
showErrorMessage
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment