diff --git a/couchpotato/core/database.py b/couchpotato/core/database.py index 0f3ece7..39c7ba1 100644 --- a/couchpotato/core/database.py +++ b/couchpotato/core/database.py @@ -60,7 +60,9 @@ class Database(object): db = self.getDB() try: - document = db.get(id) + + document_id = kwargs.get('_request').get_argument('id') + document = db.get('id', document_id) db.delete(document) return { diff --git a/couchpotato/templates/database.html b/couchpotato/templates/database.html index 6dcb35e..00ac793 100644 --- a/couchpotato/templates/database.html +++ b/couchpotato/templates/database.html @@ -55,12 +55,15 @@ (e).stop(); if(confirm('Are you sure?')){ + var a = this; new Request.JSON({ 'url': api_base + 'database.document.delete', - 'data': this.get('data-id'), + 'data': { + 'id': a.get('data-id') + }, 'onSuccess': function(){ - console.log(arguments); + a.getParent('tr').destroy(); } }).send(); }