fix(auth mnesia api): fix get file type error

This commit is contained in:
zhanghongtong 2021-09-09 10:53:59 +08:00 committed by Rory Z
parent 51f683664a
commit 3be6374f91
1 changed files with 2 additions and 2 deletions

View File

@ -304,7 +304,7 @@ sources(get, _) ->
{ok, Rules} = file:consult(Path), {ok, Rules} = file:consult(Path),
lists:append(AccIn, [#{type => file, lists:append(AccIn, [#{type => file,
enable => true, enable => true,
rules => [ io_lib:format("~p", [R])|| R <- Rules], rules => [ iolist_to_binary(io_lib:format("~p", [R])) || R <- Rules],
annotations => #{status => healthy} annotations => #{status => healthy}
}]); }]);
(#{type := _Type, annotations := #{id := Id}} = Source, AccIn) -> (#{type := _Type, annotations := #{id := Id}} = Source, AccIn) ->
@ -372,7 +372,7 @@ source(get, #{bindings := #{type := Type}}) ->
{ok, Rules} = file:consult(Path), {ok, Rules} = file:consult(Path),
{200, #{type => file, {200, #{type => file,
enable => true, enable => true,
rules => Rules, rules => [ iolist_to_binary(io_lib:format("~p", [R])) || R <- Rules],
annotations => #{status => healthy} annotations => #{status => healthy}
} }
}; };