mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 07:07:57 +01:00
Fix document add with tags (client)
This commit is contained in:
parent
03e164ea38
commit
3345f3def6
@ -18,6 +18,10 @@ App.controller('DocumentEdit', function($scope, $q, $http, $state, $stateParams,
|
||||
Restangular.one('document', $stateParams.id).get().then(function(data) {
|
||||
$scope.document = data;
|
||||
});
|
||||
} else {
|
||||
$scope.document = {
|
||||
tags: []
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@ -31,7 +35,7 @@ App.controller('DocumentEdit', function($scope, $q, $http, $state, $stateParams,
|
||||
}
|
||||
|
||||
// Extract ids from tags
|
||||
document.tags = _.pluck(document.tags, 'id');
|
||||
document['tags[]'] = _.pluck(document.tags, 'id');
|
||||
|
||||
if ($scope.isEdit()) {
|
||||
promise = Restangular
|
||||
|
Loading…
Reference in New Issue
Block a user