feat: APIs for Integration Hooks (#2250)
- Introduces JSON Schema validations via JSONSchemer - Add CRUD APIs for integration hooks
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
json.payload do
|
||||
json.array! @apps do |app|
|
||||
json.id app.id
|
||||
json.name app.name
|
||||
json.description app.description
|
||||
json.logo app.logo
|
||||
json.enabled app.enabled?(@current_account)
|
||||
json.action app.action
|
||||
json.partial! 'api/v1/models/app.json.jbuilder', resource: app
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
json.id @app.id
|
||||
json.name @app.name
|
||||
json.logo @app.logo
|
||||
json.description @app.description
|
||||
json.fields @app.fields
|
||||
json.enabled @app.enabled?(@current_account)
|
||||
json.button @app.action
|
||||
json.partial! 'api/v1/models/app.json.jbuilder', resource: @app
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! 'api/v1/models/hook.json.jbuilder', resource: @hook
|
||||
@@ -0,0 +1 @@
|
||||
json.partial! 'api/v1/models/hook.json.jbuilder', resource: @hook
|
||||
6
app/views/api/v1/models/_app.json.jbuilder
Normal file
6
app/views/api/v1/models/_app.json.jbuilder
Normal file
@@ -0,0 +1,6 @@
|
||||
json.call(resource.params, *resource.params.keys)
|
||||
json.name resource.name
|
||||
json.description resource.description
|
||||
json.enabled resource.enabled?(@current_account)
|
||||
json.button resource.action
|
||||
json.hooks @current_account.hooks.where(app_id: resource.id)
|
||||
4
app/views/api/v1/models/_hook.json.jbuilder
Normal file
4
app/views/api/v1/models/_hook.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.id resource.id
|
||||
json.app resource.app.params.to_h
|
||||
json.enabled resource.enabled?
|
||||
json.inbox_id resource.inbox_id
|
||||
Reference in New Issue
Block a user