Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
derfenix committed Apr 14, 2023
1 parent e0c91df commit e1fbfe0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions adapters/repository/badger/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ func (p *Page) GetFile(_ context.Context, pageID, fileID uuid.UUID) (*entity.Fil
return fmt.Errorf("get value: %w", err)
}

for i := range page.Results.Results() {
for j := range page.Results.Results()[i].Files {
ff := &page.Results.Results()[i].Files[j]
for i := range page.Results {
for j := range page.Results[i].Files {
ff := &page.Results[i].Files[j]

if ff.ID == fileID {
file = ff
Expand Down
4 changes: 2 additions & 2 deletions ports/rest/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ func PageToRestWithResults(page *entity.Page) openapi.PageWithResults {
Error: openapi.NewOptString(page.Meta.Error),
},
Results: func() []openapi.Result {
results := make([]openapi.Result, len(page.Results.Results()))
results := make([]openapi.Result, len(page.Results))

for i := range results {
result := &(page.Results.Results())[i]
result := &page.Results[i]

errText := openapi.OptString{}
if result.Err != nil {
Expand Down

0 comments on commit e1fbfe0

Please sign in to comment.