1
0
Fork 0

better handling database creation [ci skip]

This commit is contained in:
hkernbach 2016-06-15 00:18:13 +02:00
parent bdf3539ced
commit a43ae187d0
1 changed files with 8 additions and 10 deletions

View File

@ -185,15 +185,10 @@
}; };
this.collection.create(options, { this.collection.create(options, {
wait: false,
error: function(data, err) { error: function(data, err) {
console.log("ERROR");
self.handleError(err.status, err.statusText, dbname); self.handleError(err.status, err.statusText, dbname);
}, },
success: function() { success: function(data) {
//TODO
// add root user to newly created database
if (userName !== 'root') { if (userName !== 'root') {
$.ajax({ $.ajax({
@ -214,12 +209,15 @@
}) })
}); });
self.updateDatabases(); if (window.location.hash === '#databases') {
arangoHelper.arangoNotification("Database created."); self.updateDatabases();
window.modalView.hide(); }
window.App.naviView.dbSelectionView.render($("#dbSelect")); arangoHelper.arangoNotification("Database " + data.get("name") + " created.");
} }
}); });
arangoHelper.arangoNotification("Database creation in progress.");
window.modalView.hide();
}, },
submitDeleteDatabase: function(dbname) { submitDeleteDatabase: function(dbname) {