Skip to content

Commit

Permalink
Allow atoms-as-keys (input) while respecting the remote system
Browse files Browse the repository at this point in the history
It's probably better to spec with atoms, since the
keys will be known, but the system appears to not
work if we send in atoms, so we convert these to
binaries before going to Hex.pm
  • Loading branch information
paulo-ferraz-oliveira committed Jun 16, 2024
1 parent 2e85c6c commit 354a98c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/hex_api_release.erl
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,18 @@ delete(Config, Name, Version) when is_map(Config) and is_binary(Name) and is_bin
%% '''
%% @end
-spec retire(hex_core:config(), binary(), binary(), retirement_params()) -> hex_api:response().
retire(Config, Name, Version, Params) when
retire(Config, Name, Version, Params0) when
is_map(Config) and is_binary(Name) and is_binary(Version)
->
Path = hex_api:build_repository_path(Config, ["packages", Name, "releases", Version, "retire"]),
Params = maps:fold(
fun (K, V, AccIn) ->
AccIn#{
atom_to_binary(K) => V
}
end,
#{},
Params0),
hex_api:post(Config, Path, Params).

%% @doc
Expand Down

0 comments on commit 354a98c

Please sign in to comment.