Skip to content

Commit b224f69

Browse files
committed
chore: Update URL pagination endpoint to always return 20 results
Previously, it would always return 0 results, which was confusing. For testing purposes, it shouldn't matter that the results are repeated in this context.
1 parent 135c690 commit b224f69

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/pagination/service.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ func HandleURL(w http.ResponseWriter, r *http.Request) {
158158
ResultArray: make([]interface{}, 0),
159159
}
160160

161+
// Just always return the same 20 results
162+
for i := 0; i < total; i++ {
163+
res.ResultArray = append(res.ResultArray, i)
164+
}
165+
161166
if attempts > 1 {
162167
baseURL := fmt.Sprintf("%s://%s", r.URL.Scheme, r.Host)
163168
if r.URL.Scheme == "" { // Fallback if Scheme is not available

0 commit comments

Comments
 (0)