./ct_report/coverage/mongoose_graphql_vcard_user_mutation.COVER.html

1 -module(mongoose_graphql_vcard_user_mutation).
2 -behaviour(mongoose_graphql).
3
4 -include("mod_vcard.hrl").
5
6 -export([execute/4]).
7
8 -import(mongoose_graphql_helper, [make_error/2]).
9
10 -ignore_xref([execute/4]).
11
12 -include("../mongoose_graphql_types.hrl").
13 -include("mongoose.hrl").
14 -include("jlib.hrl").
15
16 execute(#{user := CallerJID}, vcard, <<"setVcard">>, #{<<"vcard">> := VcardInput}) ->
17 1 case mod_vcard_api:set_vcard(CallerJID, VcardInput) of
18 1 {ok, _} = Vcard -> Vcard;
19 Error ->
20
:-(
make_error(Error, #{user => jid:to_binary(CallerJID)})
21 end.
Line Hits Source