fix(bridge): don't concat names into ids
This commit is contained in:
parent
14089a572e
commit
110ae62b24
|
@ -276,7 +276,7 @@ schema("/bridges/:id/operation/:operation") ->
|
||||||
|
|
||||||
'/bridges'(post, #{body := #{<<"type">> := BridgeType} = Conf0}) ->
|
'/bridges'(post, #{body := #{<<"type">> := BridgeType} = Conf0}) ->
|
||||||
Conf = filter_out_request_body(Conf0),
|
Conf = filter_out_request_body(Conf0),
|
||||||
BridgeName = maps:get(<<"name">>, Conf, emqx_misc:gen_id()),
|
BridgeName = emqx_misc:gen_id(),
|
||||||
case emqx_bridge:lookup(BridgeType, BridgeName) of
|
case emqx_bridge:lookup(BridgeType, BridgeName) of
|
||||||
{ok, _} ->
|
{ok, _} ->
|
||||||
{400, error_msg('ALREADY_EXISTS', <<"bridge already exists">>)};
|
{400, error_msg('ALREADY_EXISTS', <<"bridge already exists">>)};
|
||||||
|
|
|
@ -212,7 +212,7 @@ schema("/connectors/:id") ->
|
||||||
{200, [format_resp(Conn) || Conn <- emqx_connector:list()]};
|
{200, [format_resp(Conn) || Conn <- emqx_connector:list()]};
|
||||||
|
|
||||||
'/connectors'(post, #{body := #{<<"type">> := ConnType} = Params}) ->
|
'/connectors'(post, #{body := #{<<"type">> := ConnType} = Params}) ->
|
||||||
ConnName = maps:get(<<"name">>, Params, emqx_misc:gen_id()),
|
ConnName = emqx_misc:gen_id(),
|
||||||
case emqx_connector:lookup(ConnType, ConnName) of
|
case emqx_connector:lookup(ConnType, ConnName) of
|
||||||
{ok, _} ->
|
{ok, _} ->
|
||||||
{400, error_msg('ALREADY_EXISTS', <<"connector already exists">>)};
|
{400, error_msg('ALREADY_EXISTS', <<"connector already exists">>)};
|
||||||
|
|
Loading…
Reference in New Issue