Skip to content

Commit

Permalink
Merge pull request #1509 from yan12125/fix-gpg-key-apis
Browse files Browse the repository at this point in the history
Fix some GPG key APIs
  • Loading branch information
svanharmelen committed Jul 26, 2022
2 parents 498b5f5 + 011d76e commit 341b4a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions users.go
Expand Up @@ -651,7 +651,7 @@ func (s *UsersService) AddGPGKey(opt *AddGPGKeyOptions, options ...RequestOption
//
// GitLab API docs: https://docs.gitlab.com/ce/api/users.html#delete-a-gpg-key
func (s *UsersService) DeleteGPGKey(key int, options ...RequestOptionFunc) (*Response, error) {
u := fmt.Sprintf("users/gpg_keys/%d", key)
u := fmt.Sprintf("user/gpg_keys/%d", key)

req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
if err != nil {
Expand Down Expand Up @@ -706,10 +706,10 @@ func (s *UsersService) GetGPGKeyForUser(user, key int, options ...RequestOptionF
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/users.html#add-a-gpg-key-for-a-given-user
func (s *UsersService) AddGPGKeyForUser(user int, options ...RequestOptionFunc) (*GPGKey, *Response, error) {
func (s *UsersService) AddGPGKeyForUser(user int, opt *AddGPGKeyOptions, options ...RequestOptionFunc) (*GPGKey, *Response, error) {
u := fmt.Sprintf("users/%d/gpg_keys", user)

req, err := s.client.NewRequest(http.MethodPost, u, nil, options)
req, err := s.client.NewRequest(http.MethodPost, u, opt, options)
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit 341b4a0

Please sign in to comment.