mirror of
https://github.com/processone/ejabberd
synced 2025-10-04 18:29:20 +02:00
mod_http_api: When using API version>0, avoid result names for integers and strings
This commit is contained in:
parent
8671bf70ab
commit
d570870be5
1 changed files with 9 additions and 1 deletions
|
@ -412,7 +412,15 @@ format_command_result(Cmd, Auth, Result, Version) ->
|
|||
{_, T} = format_result(Result, ResultFormat),
|
||||
{200, T};
|
||||
_ ->
|
||||
{200, {[format_result(Result, ResultFormat)]}}
|
||||
OtherResult1 = format_result(Result, ResultFormat),
|
||||
OtherResult2 = case Version of
|
||||
0 ->
|
||||
{[OtherResult1]};
|
||||
_ ->
|
||||
{_, Other3} = OtherResult1,
|
||||
Other3
|
||||
end,
|
||||
{200, OtherResult2}
|
||||
end.
|
||||
|
||||
format_result(Atom, {Name, atom}) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue