Delete documents
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user