forked from security/hakurei
cmd/pkgserver: remove get endpoint count field
This commit is contained in:
@@ -103,7 +103,6 @@ func (index *packageIndex) handleGet(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
values := index.sorts[sort][i:min(i+limit, len(index.sorts[sort]))]
|
||||
// TODO(mae): remove count field
|
||||
writeAPIPayload(w, &struct {
|
||||
Values []*metadata `json:"values"`
|
||||
}{values})
|
||||
|
||||
@@ -45,7 +45,6 @@ async function infoRequest(): Promise<InfoPayload> {
|
||||
return payload as InfoPayload
|
||||
}
|
||||
class GetPayload {
|
||||
count: number
|
||||
values: PackageIndexEntry[]
|
||||
}
|
||||
|
||||
@@ -108,9 +107,9 @@ class State {
|
||||
.then(res => {
|
||||
let table = document.getElementById("pkg-list")
|
||||
table.innerHTML = ''
|
||||
for(let i = 0; i < res.count; i++) {
|
||||
table.appendChild(toHTML(res.values[i]))
|
||||
}
|
||||
res.values.forEach((row) => {
|
||||
table.appendChild(toHTML(row))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user