Skip to content

Commit 0935462

Browse files
feat(routes): use post method for all routes with params
1 parent d6d7955 commit 0935462

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

packages/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/collection.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def list(caller, filter, projection)
6464
"Forwarding '#{@name}' list call to the Rpc agent on #{url}."
6565
)
6666

67-
@client.call_rpc(url, method: :get, payload: params)
67+
@client.call_rpc(url, method: :post, payload: params)
6868
end
6969

7070
def create(caller, data)
@@ -88,7 +88,7 @@ def update(caller, filter, data)
8888
"Forwarding '#{@name}' update call to the Rpc agent on #{url}."
8989
)
9090

91-
@client.call_rpc(url, method: :put, payload: params)
91+
@client.call_rpc(url, method: :post, payload: params)
9292
end
9393

9494
def delete(caller, filter)
@@ -100,7 +100,7 @@ def delete(caller, filter)
100100
"Forwarding '#{@name}' deletion call to the Rpc agent on #{url}."
101101
)
102102

103-
@client.call_rpc(url, method: :delete, payload: params)
103+
@client.call_rpc(url, method: :post, payload: params)
104104
end
105105

106106
def aggregate(caller, filter, aggregation, limit = nil)
@@ -113,7 +113,7 @@ def aggregate(caller, filter, aggregation, limit = nil)
113113
"Forwarding '#{@name}' aggregate call to the Rpc agent on #{url}."
114114
)
115115

116-
@client.call_rpc(url, method: :get, payload: params)
116+
@client.call_rpc(url, method: :post, payload: params)
117117
end
118118

119119
def execute(caller, name, data, filter = nil)
@@ -164,7 +164,7 @@ def render_chart(caller, name, record_id)
164164
"Forwarding '#{@name}' chart #{name} call to the Rpc agent on #{url}."
165165
)
166166

167-
@client.call_rpc(url, method: :get, payload: params)
167+
@client.call_rpc(url, method: :post, payload: params)
168168
end
169169

170170
private

packages/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/datasource.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def render_chart(caller, name)
3131
"Forwarding datasource chart '#{name}' call to the Rpc agent on #{url}."
3232
)
3333

34-
client.call_rpc(url, method: :get, payload: { chart: name, caller: caller.to_h })
34+
client.call_rpc(url, method: :post, payload: { chart: name, caller: caller.to_h })
3535
end
3636
end
3737
end

packages/forest_admin_rpc_agent/lib/forest_admin_rpc_agent/routes/aggregate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Aggregate < BaseRoute
88
include ForestAdminAgent::Routes::QueryHandler
99

1010
def initialize
11-
super('rpc/:collection_name/aggregate', 'get', 'rpc_aggregate')
11+
super('rpc/:collection_name/aggregate', 'post', 'rpc_aggregate')
1212
end
1313

1414
def handle_request(args)

packages/forest_admin_rpc_agent/lib/forest_admin_rpc_agent/routes/chart.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Chart < BaseRoute
66
include ForestAdminDatasourceToolkit::Components::Query
77

88
def initialize
9-
super('rpc/:collection_name/chart', 'get', 'rpc_chart_collection')
9+
super('rpc/:collection_name/chart', 'post', 'rpc_chart_collection')
1010
end
1111

1212
def handle_request(args)

packages/forest_admin_rpc_agent/lib/forest_admin_rpc_agent/routes/datasource_chart.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module ForestAdminRpcAgent
44
module Routes
55
class DatasourceChart < BaseRoute
66
def initialize
7-
super('rpc/datasource-chart', 'get', 'rpc_chart_datasource')
7+
super('rpc/datasource-chart', 'post', 'rpc_chart_datasource')
88
end
99

1010
def handle_request(args)

packages/forest_admin_rpc_agent/lib/forest_admin_rpc_agent/routes/delete.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Delete < BaseRoute
88
include ForestAdminAgent::Routes::QueryHandler
99

1010
def initialize
11-
super('rpc/:collection_name/delete', 'delete', 'rpc_delete')
11+
super('rpc/:collection_name/delete', 'post', 'rpc_delete')
1212
end
1313

1414
def handle_request(args)

packages/forest_admin_rpc_agent/lib/forest_admin_rpc_agent/routes/list.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class List < BaseRoute
88
include ForestAdminAgent::Routes::QueryHandler
99

1010
def initialize
11-
super('rpc/:collection_name/list', 'get', 'rpc_list')
11+
super('rpc/:collection_name/list', 'post', 'rpc_list')
1212
end
1313

1414
def handle_request(args)

packages/forest_admin_rpc_agent/lib/forest_admin_rpc_agent/routes/update.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Update < BaseRoute
66
include ForestAdminDatasourceToolkit::Components::Query
77

88
def initialize
9-
super('rpc/:collection_name/update', 'put', 'rpc_update')
9+
super('rpc/:collection_name/update', 'post', 'rpc_update')
1010
end
1111

1212
def handle_request(args)

0 commit comments

Comments
 (0)