Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-01 19:06:05 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-17 20:10:13 +0300
commitb34c063ec428f1fd890a357a3f8ac7c129ee4c46 (patch)
tree1a00aba47d314a061ffc9e4fbe49147019d85785 /lib/api/subscriptions.rb
parent091efb315296306fd8c8d7c109ad6df77e7f28d5 (diff)
Pass project to Entities::Label to check if user is subscribed
Diffstat (limited to 'lib/api/subscriptions.rb')
-rw-r--r--lib/api/subscriptions.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/api/subscriptions.rb b/lib/api/subscriptions.rb
index 00a79c24f96..10749b34004 100644
--- a/lib/api/subscriptions.rb
+++ b/lib/api/subscriptions.rb
@@ -24,11 +24,11 @@ module API
post ":id/#{type}/:subscribable_id/subscription" do
resource = instance_exec(params[:subscribable_id], &finder)
- if resource.subscribed?(current_user)
+ if resource.subscribed?(current_user, user_project)
not_modified!
else
- resource.subscribe(current_user)
- present resource, with: entity_class, current_user: current_user
+ resource.subscribe(current_user, user_project)
+ present resource, with: entity_class, current_user: current_user, project: user_project
end
end
@@ -38,11 +38,11 @@ module API
delete ":id/#{type}/:subscribable_id/subscription" do
resource = instance_exec(params[:subscribable_id], &finder)
- if !resource.subscribed?(current_user)
+ if !resource.subscribed?(current_user, user_project)
not_modified!
else
- resource.unsubscribe(current_user)
- present resource, with: entity_class, current_user: current_user
+ resource.unsubscribe(current_user, user_project)
+ present resource, with: entity_class, current_user: current_user, project: user_project
end
end
end