Add invitations resource

stable
David Barragán Merino 2014-07-13 16:24:25 +02:00
parent bcd955bd2b
commit 3fe3edfc77
2 changed files with 39 additions and 1 deletions

View File

@ -26,6 +26,7 @@ class ResourcesService extends taiga.Service
urls = {
"auth": "/api/v1/auth"
"auth-register": "/api/v1/auth/register"
"invitations": "/api/v1/invitations"
"permissions": "/api/v1/permissions"
"roles": "/api/v1/roles"
"projects": "/api/v1/projects"
@ -106,9 +107,10 @@ module.run([
"$tgProjectsResourcesProvider",
"$tgSprintsResourcesProvider",
"$tgUserstoriesResourcesProvider",
"$tgMdRenderResourcesProvider",
"$tgTasksResourcesProvider",
"$tgIssuesResourcesProvider",
"$tgSearchResourcesProvider",
"$tgMdRenderResourcesProvider",
"$tgInvitationsResourcesProvider",
initResources
])

View File

@ -0,0 +1,36 @@
###
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán Merino <bameda@dbarragan.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# File: modules/resources/projects.coffee
###
taiga = @.taiga
resourceProvider = ($repo) ->
service = {}
service.get = (token) ->
return $repo.queryOne("invitations", token)
return (instance) ->
instance.invitations = service
module = angular.module("taigaResources")
module.factory("$tgInvitationsResourcesProvider", ["$tgRepo", resourceProvider])