Improved delete request transaction

This commit is contained in:
Luke Vella 2015-01-26 15:35:08 +01:00
parent 1b20a11bba
commit 59caf01443
15 changed files with 18 additions and 10343 deletions

View file

@ -73,7 +73,7 @@ angular.module('rallly')
}
}
})
.directive('settingsForm', function(Event){
.directive('settingsForm', function(Event, ConfirmModal){
return {
scope : {
event : '=',
@ -82,8 +82,14 @@ angular.module('rallly')
templateUrl : 'templates/directives/eventForm/settingsForm.html',
link : function(scope, el, attrs){
scope.deleteEvent = function(){
if (scope.deleteRequestSent) return;
Event.delete({'id' : scope.event._id}, function(){
console.log('delete');
scope.deleteRequestSent = true;
var modal = new ConfirmModal({
title : 'Delete Request Sent',
message : 'An email has been sent to the creator of this event with instructions to delete it.',
cancelText : 'OK'
});
});
}
}