fix(emqx_authz_api_sources): use merge replace foldl
This commit is contained in:
parent
740b3870bf
commit
258d2e9e03
|
@ -232,10 +232,7 @@ source(get, #{bindings := #{type := Type}}) ->
|
|||
#{annotations := #{id := ResourceId }} ->
|
||||
case lookup_from_all_nodes(ResourceId) of
|
||||
{ok, StatusAndMetrics} ->
|
||||
Fun = fun ({Key, Val}, Map) -> maps:put(Key, Val, Map) end,
|
||||
{200, lists:foldl(Fun,
|
||||
read_certs(Source),
|
||||
maps:to_list(StatusAndMetrics))};
|
||||
{200, maps:merge(read_certs(Source), StatusAndMetrics)};
|
||||
{error, ErrorMsg} -> {500, ErrorMsg}
|
||||
end;
|
||||
_ -> {200, read_certs(Source)}
|
||||
|
|
Loading…
Reference in New Issue