chore(gw): ignore needless args

This commit is contained in:
JianBo He 2021-12-08 11:33:11 +08:00
parent a937a3d4dc
commit e48f10d2d6
1 changed files with 3 additions and 1 deletions

View File

@ -126,10 +126,12 @@ gateway_insta(get, #{bindings := #{name := Name0}}) ->
error : badarg -> error : badarg ->
return_http_error(400, "Bad gateway name") return_http_error(400, "Bad gateway name")
end; end;
gateway_insta(put, #{body := GwConf, gateway_insta(put, #{body := GwConf0,
bindings := #{name := Name0} bindings := #{name := Name0}
}) -> }) ->
with_gateway(Name0, fun(GwName, _) -> with_gateway(Name0, fun(GwName, _) ->
%% XXX: Clear the unused fields
GwConf = maps:without([<<"name">>], GwConf0),
case emqx_gateway_conf:update_gateway(GwName, GwConf) of case emqx_gateway_conf:update_gateway(GwName, GwConf) of
{ok, Gateway} -> {ok, Gateway} ->
{200, Gateway}; {200, Gateway};