travis-api/lib/travis/api/v3/services/env_var/delete.rb
Joe Corcoran cae6da540f Add env vars endpoints
This adds API V3 endpoints for querying, creating, modifying and
deleting environment variables.

It has no concept of encryption yet and should be considered a work in
progress.

We should also talk about the slightly off-track approach in the
EnvVars::Create service – maybe there's a way to standardise the
querying and rendering for post requests?

2016-06-21 15:34:11 +02:00

13 lines
352 B
Ruby

module Travis::API::V3
class Services::EnvVar::Delete < Service
params :id, prefix: :repository
params :id, prefix: :env_var
def run!
raise LoginRequired unless access_control.logged_in? or access_control.full_access?
raise NotFound unless repository = find(:repository)
query.delete(repository)
end
end
end