Skip to content

Commit

Permalink
core:hotfix - Add validation in repositories when not exist pagination (
Browse files Browse the repository at this point in the history
#571)

Signed-off-by: Wilian Gabriel <[email protected]>
  • Loading branch information
wiliansilvazup authored Feb 25, 2022
1 parent 8d7f2de commit 1c0b37e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/internal/repositories/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,12 @@ func (r *Repository) listRepositoriesWhenWorkspaceAdmin(accountID,
workspaceID uuid.UUID, paginated *repositoryEntities.PaginatedContent) (*[]repositoryEntities.Response, error) {
repositories := &[]repositoryEntities.Response{}

filters := []interface{}{accountID, workspaceID}
if paginated.Enable {
filters = append(filters, paginated.GetSearch())
}
return repositories, r.databaseRead.Raw(r.queryListRepositoriesWhenWorkspaceAdmin(paginated),
repositories, accountID, workspaceID, paginated.GetSearch()).GetErrorExceptNotFound()
repositories, filters...).GetErrorExceptNotFound()
}

func (r *Repository) queryListRepositoriesWhenWorkspaceAdmin(paginated *repositoryEntities.PaginatedContent) string {
Expand Down

0 comments on commit 1c0b37e

Please sign in to comment.