Skip to content

Commit 8a2ba86

Browse files
authored
Refactor validate_request by removing shape_definition_params
Removed the @shape_definition_params constant and updated the parameter handling in validate_request.
1 parent 5440ad6 commit 8a2ba86

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

packages/sync-service/lib/electric/plug/delete_shape_plug.ex

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,13 @@ defmodule Electric.Plug.DeleteShapePlug do
1515
# list narrow (rather than passing the query params through wholesale) means
1616
# request-only parameters such as `offset` and `live`, which
1717
# `validate_for_delete/2` deliberately does not validate, stay out.
18-
@shape_definition_params ~w(
19-
table
20-
where
21-
params
22-
columns
23-
queryable_columns
24-
replica
25-
log
26-
experimental_compaction
27-
)
2818

2919
defp validate_request(%Plug.Conn{assigns: %{config: config}} = conn, _) do
3020
api = Access.fetch!(config, :api)
3121

3222
all_params =
3323
Map.merge(conn.query_params, conn.path_params)
34-
|> Map.take(["handle" | @shape_definition_params])
24+
|> Map.take(["table" | "handle" | "where" | "params" | "columns" | "queryable_columns" | "replica" | "log" | "experimental_compaction"])
3525
|> Map.put("offset", "-1")
3626

3727
case Api.validate_for_delete(api, all_params) do

0 commit comments

Comments
 (0)