Verified Commit bc1cd7bb authored by Zubeen's avatar Zubeen 🤖 Committed by GitLab
Browse files

fix(events): trim leading @ from username in ListUserContributionEvents

Changelog: Improvements
parent 43968b2e
Loading
Loading
Loading
Loading
+1 −6
Changes for events.go: 1 added line, 6 removed lines.
Original line number Diff line number Diff line
@@ -126,13 +126,8 @@ type ListContributionEventsOptions struct {
}

func (s *UsersService) ListUserContributionEvents(uid any, opt *ListContributionEventsOptions, options ...RequestOptionFunc) ([]*ContributionEvent, *Response, error) {
	user, err := parseID(uid)
	if err != nil {
		return nil, nil, err
	}

	return do[[]*ContributionEvent](s.client,
		withPath(routeUsersIDEvents, user),
		withPath(routeUsersIDEvents, UserID{uid}),
		withAPIOpts(opt),
		withRequestOpts(options...),
	)
+5 −1
Changes for users.go: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -348,7 +348,11 @@ type (
		// https://docs.gitlab.com/api/users/#delete-authentication-identity-from-a-user
		DeleteUserIdentity(user int64, provider string, options ...RequestOptionFunc) (*Response, error)

		// events.go
		// ListUserContributionEvents retrieves the contribution events for the
		// specified user, sorted from newest to oldest.
		//
		// GitLab API docs:
		// https://docs.gitlab.com/api/events/#retrieve-contribution-events-for-a-user
		ListUserContributionEvents(uid any, opt *ListContributionEventsOptions, options ...RequestOptionFunc) ([]*ContributionEvent, *Response, error)
	}