Added attachment creation from link/name

This commit is contained in:
Dan Brown
2016-10-10 21:13:18 +01:00
parent ac0b29fb6d
commit 89509b487a
7 changed files with 96 additions and 8 deletions

View File

@ -606,6 +606,18 @@ module.exports = function (ngApp, events) {
});
};
$scope.attachLinkSubmit = function(fileName, fileLink) {
$http.post('/files/link', {
uploaded_to: pageId,
name: fileName,
link: fileLink
}).then(resp => {
$scope.files.unshift(resp.data);
events.emit('success', 'Link attached');
});
$scope.fileName = $scope.fileLink = '';
};
}]);
};