./ct_report/coverage/mongoose_graphql_vcard_user_query.COVER.html

1 -module(mongoose_graphql_vcard_user_query).
2 -behaviour(mongoose_graphql).
3
4 -export([execute/4]).
5
6 -import(mongoose_graphql_helper, [make_error/2, null_to_default/2]).
7
8 -ignore_xref([execute/4]).
9
10 -include("../mongoose_graphql_types.hrl").
11 -include("mongoose.hrl").
12 -include("jlib.hrl").
13
14 execute(#{user := CallerJID}, vcard, <<"getVcard">>, #{<<"user">> := UserJID}) ->
15 6 UserJID2 = null_to_default(UserJID, CallerJID),
16 6 case mod_vcard_api:get_vcard(UserJID2) of
17 3 {ok, _} = Vcard -> Vcard;
18 {ErrorCode, ErrorMessage} ->
19 3 make_error({ErrorCode, ErrorMessage}, #{<<"user">> => UserJID2})
20 end.
Line Hits Source