Skip to content

Commit

Permalink
Removed some unneeded comments
Browse files Browse the repository at this point in the history
  • Loading branch information
corbadoman committed Sep 23, 2024
1 parent 829aaed commit f224c38
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions internal/services/identifier/identifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,22 @@ func (i *Impl) List(
) (*api.IdentifierList, error) {
var req api.IdentifierListParams

// Only set filter if it's not nil or empty
if len(filter) > 0 {
req.Filter = &filter
}

// Only set sort if it's not empty
if sort != "" {
req.Sort = &sort
}

// Only set page if it's greater than 0
if page > 0 {
req.Page = &page
}

// Only set pageSize if it's greater than 0
if pageSize > 0 {
req.PageSize = &pageSize
}

// Call the API with the prepared request
res, err := i.client.IdentifierListWithResponse(ctx, &req, editors...)
if err != nil {
return nil, errors.WithStack(err)
Expand Down Expand Up @@ -147,8 +142,6 @@ func (i *Impl) ListByUserID(
editors ...api.RequestEditorFn,
) (*api.IdentifierList, error) {
userID = strings.TrimPrefix(userID, "usr-")

// Construct the filter
filter := []string{`userID:eq:` + userID}

return i.List(ctx, filter, sort, page, pageSize, editors...)
Expand All @@ -165,9 +158,8 @@ func (i *Impl) ListByUserIDAndType(
editors ...api.RequestEditorFn,
) (*api.IdentifierList, error) {
userID = strings.TrimPrefix(userID, "usr-")

// Construct the filter
filter := []string{`userID:eq:` + userID, `identifierType:eq:` + string(identifierType)}

return i.List(ctx, filter, sort, page, pageSize, editors...)
}

Expand Down

0 comments on commit f224c38

Please sign in to comment.