mirror of
https://github.com/derfenix/webarchive.git
synced 2026-03-11 12:41:54 +03:00
Refactoring
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user