From fbd89ceeb0c4d3682e26fe04f7f105248153273b Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Thu, 27 Sep 2012 17:14:50 +0200 Subject: [PATCH] fix accounts and hooks endpoints --- lib/travis/api/app/endpoint/accounts.rb | 2 +- lib/travis/api/app/endpoint/authorization.rb | 2 +- lib/travis/api/app/endpoint/hooks.rb | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/travis/api/app/endpoint/accounts.rb b/lib/travis/api/app/endpoint/accounts.rb index 0626e94f..40ea1dad 100644 --- a/lib/travis/api/app/endpoint/accounts.rb +++ b/lib/travis/api/app/endpoint/accounts.rb @@ -4,7 +4,7 @@ class Travis::Api::App class Endpoint class Accounts < Endpoint get '/', scope: :private do - body service(:account).find_all, type: :account + body service(:account).find_all, type: :accounts end end end diff --git a/lib/travis/api/app/endpoint/authorization.rb b/lib/travis/api/app/endpoint/authorization.rb index 940237fd..2c78a3e7 100644 --- a/lib/travis/api/app/endpoint/authorization.rb +++ b/lib/travis/api/app/endpoint/authorization.rb @@ -115,7 +115,7 @@ class Travis::Api::App get '/post_message' do handshake do |user, token, target_origin| halt 403, invalid_target(target_origin) unless target_ok? target_origin - rendered_user = Travis::Api.data(service(:user, user).find_one, type: :user, version: :v2) + rendered_user = Travis::Api.data(user, version: :v2) post_message(token: token, user: rendered_user, target_origin: target_origin) end end diff --git a/lib/travis/api/app/endpoint/hooks.rb b/lib/travis/api/app/endpoint/hooks.rb index cfea0a89..e2ea4c78 100644 --- a/lib/travis/api/app/endpoint/hooks.rb +++ b/lib/travis/api/app/endpoint/hooks.rb @@ -5,8 +5,7 @@ class Travis::Api::App # TODO: Add documentation. class Hooks < Endpoint # TODO: Add implementation and documentation. - # TODO scope: :private - get('/') do + get('/', scope: :private) do body service(:hooks).find_all(params), type: :hooks end