Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Conversation

@lordspinach
Copy link

No description provided.

func (g *GormGenericRepository[EntityIDType, EntityType]) GetList(ctx context.Context, orderBy string, orderDirection string, page int, size int, queryBuilder interfaces.IQueryBuilder) ([]EntityType, error) {
g.log(ctx, "debug", fmt.Sprintf("GetList: IN: orderBy=%s, orderDirection=%s, page=%d, size=%d, queryBuilder=%s", orderBy, orderDirection, page, size, queryBuilder))
if page < 0 || size < 0 {
return nil, errors.Internal.New("page and page size cannot be negative")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zero values not correct too

assert.NoError(t.t, err)
assert.Equal(t.t, 3, len(list))
}))
t.t.Run(fmt.Sprintf("%s/NegativePageAndPageSize/OK", t.getTestBaseName()),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name will be NegativePageAndPageSize/Error i think

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants