Stop filtering out mp-* props
This commit is contained in:
parent
85c46f927f
commit
0c38da7de7
1 changed files with 1 additions and 5 deletions
|
@ -299,10 +299,7 @@ defmodule PlugMicropub do
|
||||||
defp parse_create_body("application/json", params) do
|
defp parse_create_body("application/json", params) do
|
||||||
with {:ok, ["h-" <> type]} <- Map.fetch(params, "type"),
|
with {:ok, ["h-" <> type]} <- Map.fetch(params, "type"),
|
||||||
{:ok, properties} when is_map(properties) <- Map.fetch(params, "properties") do
|
{:ok, properties} when is_map(properties) <- Map.fetch(params, "properties") do
|
||||||
properties =
|
properties = Map.new(properties)
|
||||||
properties
|
|
||||||
|> Enum.reject(&match?({"mp-" <> _, _}, &1))
|
|
||||||
|> Map.new()
|
|
||||||
|
|
||||||
{:ok, type, properties}
|
{:ok, type, properties}
|
||||||
else
|
else
|
||||||
|
@ -314,7 +311,6 @@ defmodule PlugMicropub do
|
||||||
with {type, params} when is_binary(type) <- Map.pop(params, "h") do
|
with {type, params} when is_binary(type) <- Map.pop(params, "h") do
|
||||||
properties =
|
properties =
|
||||||
params
|
params
|
||||||
|> Enum.reject(&match?({"mp-" <> _, _}, &1))
|
|
||||||
|> Enum.map(fn {k, v} -> {k, List.wrap(v)} end)
|
|> Enum.map(fn {k, v} -> {k, List.wrap(v)} end)
|
||||||
|> Map.new()
|
|> Map.new()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue