fix: discard the 'id' field when testing a resource

This commit is contained in:
Shawn 2022-10-08 10:50:42 +08:00
parent ab3ec9c176
commit 1bb7c23db1
1 changed files with 1 additions and 1 deletions

View File

@ -306,7 +306,7 @@ show_action(#{name := Name}, _Params) ->
create_resource(#{}, Params) ->
case parse_resource_params(Params) of
{ok, ParsedParams} ->
if_test(fun() -> do_create_resource(test_resource, ParsedParams) end,
if_test(fun() -> do_create_resource(test_resource, maps:without([id], ParsedParams)) end,
fun() -> do_create_resource(create_resource, ParsedParams) end,
Params);
{error, Reason} ->