mirror of
https://github.com/sismics/docs.git
synced 2025-12-15 18:56:18 +00:00
Init share app, client refactoring
This commit is contained in:
22
docs-web/src/main/webapp/app/share/controller/Share.js
Normal file
22
docs-web/src/main/webapp/app/share/controller/Share.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Share controller.
|
||||
*/
|
||||
App.controller('Share', function($scope, $state, $stateParams, Restangular) {
|
||||
// Load document
|
||||
Restangular.one('document', $stateParams.documentId).get({ share: $stateParams.shareId })
|
||||
.then(function (data) {
|
||||
$scope.document = data;
|
||||
}, function (response) {
|
||||
if (response.data.status == 403) {
|
||||
// TODO Sharing no more valid
|
||||
}
|
||||
});
|
||||
|
||||
// Load files
|
||||
Restangular.one('file').getList('list', { id: $stateParams.documentId, share: $stateParams.shareId })
|
||||
.then(function (data) {
|
||||
$scope.files = data.files;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user