diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-04-18 09:41:20 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-04-18 09:41:20 +0530 |
commit | ed1be10087e0bffc9a9b4c27d9c7dc8dfba9b427 (patch) | |
tree | 50d5d18cb0ed09043711274ca4bf7fa9d1db2682 /lib/api/projects.rb | |
parent | cfcd95b0c3c0c3699de8724e60cc2bce687a9132 (diff) | |
parent | e9f20f5922e9c365b4af14e53881a7bafba4139c (diff) | |
download | gitlab-ce-14552-signup-password-leak.tar.gz |
Merge remote-tracking branch 'origin/master' into 14552-signup-password-leak14552-signup-password-leak
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 24b31005475..cc2c7a0c503 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -272,6 +272,40 @@ module API present user_project, with: Entities::Project end + # Star project + # + # Parameters: + # id (required) - The ID of a project + # Example Request: + # POST /projects/:id/star + post ':id/star' do + if current_user.starred?(user_project) + not_modified! + else + current_user.toggle_star(user_project) + user_project.reload + + present user_project, with: Entities::Project + end + end + + # Unstar project + # + # Parameters: + # id (required) - The ID of a project + # Example Request: + # DELETE /projects/:id/star + delete ':id/star' do + if current_user.starred?(user_project) + current_user.toggle_star(user_project) + user_project.reload + + present user_project, with: Entities::Project + else + not_modified! + end + end + # Remove project # # Parameters: |