projects
/
angular-drzb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
980825e
)
remove work data if there is no need for one
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 14 Dec 2012 10:14:55 +0000
(11:14 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 14 Dec 2012 10:14:55 +0000
(11:14 +0100)
app/js/controllers.js
patch
|
blob
|
history
diff --git
a/app/js/controllers.js
b/app/js/controllers.js
index
673ac2e
..
4187b9a
100644
(file)
--- a/
app/js/controllers.js
+++ b/
app/js/controllers.js
@@
-10,6
+10,11
@@
function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $
$scope.update = function(registration) {
+ if ( ! $scope.has_work && registration.work ) {
+ delete( registration.work );
+ $log.info("removed work");
+ }
+
registration.$save( function(registration) {
$log.info("saved", registration);
$log.info('id =', registration.id);