feat(invitations): list Effective invitations on detail view

This commit is contained in:
OldHawk
2017-06-14 17:28:40 +08:00
parent a451ad5541
commit f86738dcb0
8 changed files with 135 additions and 15 deletions

View File

@@ -5,10 +5,10 @@
.module('invitations')
.controller('InviteController', InviteController);
InviteController.$inject = ['$rootScope', '$scope', '$state', '$translate', '$timeout', 'Authentication', '$window', 'MeanTorrentConfig',
'NotifycationService', 'InvitationsService'];
InviteController.$inject = ['$scope', '$state', '$translate', '$timeout', 'Authentication', '$window', 'MeanTorrentConfig', 'NotifycationService',
'InvitationsService'];
function InviteController($rootScope, $scope, $state, $translate, $timeout, Authentication, $window, MeanTorrentConfig, NotifycationService,
function InviteController($scope, $state, $translate, $timeout, Authentication, $window, MeanTorrentConfig, NotifycationService,
InvitationsService) {
var vm = this;
vm.inviteConfig = MeanTorrentConfig.meanTorrentConfig.invite;
@@ -22,9 +22,15 @@
}
/**
* init
* getMyInvitations
*/
vm.init = function () {
vm.getMyInvitations = function () {
InvitationsService.get({}, function (items) {
vm.my_invitations = items.my_invitations;
vm.used_invitations = items.used_invitations;
}, function (res) {
NotifycationService.showErrorNotify('GET_INVITATIONS_ERROR');
});
};
}
}());