From 3fe3edfc77d760ef69d6dcb0ecd753e0b9b5e753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Sun, 13 Jul 2014 16:24:25 +0200 Subject: [PATCH] Add invitations resource --- app/coffee/modules/resources.coffee | 4 ++- .../modules/resources/invitations.coffee | 36 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 app/coffee/modules/resources/invitations.coffee diff --git a/app/coffee/modules/resources.coffee b/app/coffee/modules/resources.coffee index b25a9bdf..cda6e546 100644 --- a/app/coffee/modules/resources.coffee +++ b/app/coffee/modules/resources.coffee @@ -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 ]) diff --git a/app/coffee/modules/resources/invitations.coffee b/app/coffee/modules/resources/invitations.coffee new file mode 100644 index 00000000..5cdbcecc --- /dev/null +++ b/app/coffee/modules/resources/invitations.coffee @@ -0,0 +1,36 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# 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])