diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2015-12-31 16:56:03 +0100 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2015-12-31 16:56:03 +0100 |
commit | 0d014feb1d216e692882976f0d70c3227eaec4ca (patch) | |
tree | 235784b5251e437efe88edc86d70ae09b949c2f4 /lib/api/variables.rb | |
parent | a692ce1c079703c4f3947e1d0a29547189e94d0f (diff) | |
download | gitlab-ce-0d014feb1d216e692882976f0d70c3227eaec4ca.tar.gz |
Add delete feature to variables API
Diffstat (limited to 'lib/api/variables.rb')
-rw-r--r-- | lib/api/variables.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/api/variables.rb b/lib/api/variables.rb index 6522ecba70c..c70c7cd9d7b 100644 --- a/lib/api/variables.rb +++ b/lib/api/variables.rb @@ -57,6 +57,18 @@ module API present variable, with: Entities::Variable end + + # Delete existing variable of a project + # + # Parameters: + # id (required) - The ID of a project + # variable_id (required) - The ID of a variable + # Exanoke Reqyest: + # DELETE /projects/:id/variables/:variable_id + delete ':id/variables/:variable_id' do + variable = user_project.variables.where(id: params[:variable_id].to_i).first + variable.destroy + end end end end |