Merge pull request #5568 from DDDHuang/fix_tr_api

fix: topic rewrite api method
This commit is contained in:
DDDHuang 2021-08-26 11:22:16 +08:00 committed by GitHub
commit 7e63e2b6eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ rewrite_api() ->
<<"200">> => object_array_schema(properties(), <<"List all rewrite rules">>)
}
},
post => #{
put => #{
description => <<"Update topic rewrite">>,
'requestBody' => object_array_schema(properties()),
responses => #{
@ -63,7 +63,7 @@ rewrite_api() ->
topic_rewrite(get, _Params) ->
{200, emqx_rewrite:list()};
topic_rewrite(post, #{body := Body}) ->
topic_rewrite(put, #{body := Body}) ->
case length(Body) < ?MAX_RULES_LIMIT of
true ->
ok = emqx_rewrite:update(Body),