Commit 1731c092 authored by Johannes Zellner's avatar Johannes Zellner

Add project delete confirm dialog

parent 6101735f
......@@ -175,17 +175,23 @@ new Vue({
deleteProject: function (projectId, scope) {
var that = this;
scope.row.busy = true;
superagent.delete('/api/v1/projects/' + projectId).query({ username: that.login.username, password: that.login.password }).end(function (error, result) {
scope.row.busy = false;
if (error) return that.onError(error);
if (result.statusCode !== 202) return that.onError('Unexpected response: ' + result.statusCode + ' ' + result.text);
// update the ui now
that.refreshProjects();
});
this.$confirm('Really remove this Project?', 'Warning', {
confirmButtonText: 'OK',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(function () {
scope.row.busy = true;
superagent.delete('/api/v1/projects/' + projectId).query({ username: that.login.username, password: that.login.password }).end(function (error, result) {
scope.row.busy = false;
if (error) return that.onError(error);
if (result.statusCode !== 202) return that.onError('Unexpected response: ' + result.statusCode + ' ' + result.text);
// update the ui now
that.refreshProjects();
});
}).catch(function () {});
},
sort: function (a, b) {
// default sorting uses case-sensitive sorting
......
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