fix accounts and hooks endpoints
This commit is contained in:
parent
f2e8ccafc1
commit
fbd89ceeb0
|
@ -4,7 +4,7 @@ class Travis::Api::App
|
||||||
class Endpoint
|
class Endpoint
|
||||||
class Accounts < Endpoint
|
class Accounts < Endpoint
|
||||||
get '/', scope: :private do
|
get '/', scope: :private do
|
||||||
body service(:account).find_all, type: :account
|
body service(:account).find_all, type: :accounts
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -115,7 +115,7 @@ class Travis::Api::App
|
||||||
get '/post_message' do
|
get '/post_message' do
|
||||||
handshake do |user, token, target_origin|
|
handshake do |user, token, target_origin|
|
||||||
halt 403, invalid_target(target_origin) unless target_ok? 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)
|
post_message(token: token, user: rendered_user, target_origin: target_origin)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,8 +5,7 @@ class Travis::Api::App
|
||||||
# TODO: Add documentation.
|
# TODO: Add documentation.
|
||||||
class Hooks < Endpoint
|
class Hooks < Endpoint
|
||||||
# TODO: Add implementation and documentation.
|
# TODO: Add implementation and documentation.
|
||||||
# TODO scope: :private
|
get('/', scope: :private) do
|
||||||
get('/') do
|
|
||||||
body service(:hooks).find_all(params), type: :hooks
|
body service(:hooks).find_all(params), type: :hooks
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user