diff --git a/js/app.js b/js/app.js index ab3fd805..a6fe4170 100644 --- a/js/app.js +++ b/js/app.js @@ -481,6 +481,19 @@ app = Sammy('#main', function (sam) { }, 'POST', params); }); + sam.get('#/domains/:domain/delete', function (c) { + if (confirm('Are you sure you want to delete '+ c.params['domain'] +' ?')) { + c.api('/domains/'+ c.params['domain'], function(data) { // http://api.yunohost.org/#!/domain/domain_remove_delete_3 + store.clear('slide'); + c.redirect('#/domains'); + }, 'DELETE'); + } else { + store.clear('slide'); + c.redirect('#/domains'); + } + }); + + /** * Apps * diff --git a/views/domain_list.ms b/views/domain_list.ms index 4cb555dd..f7a1dc37 100644 --- a/views/domain_list.ms +++ b/views/domain_list.ms @@ -9,11 +9,13 @@