fix: count sliced Entries in response
This commit is contained in:
parent
6419e9fffd
commit
dbd63cfc42
1 changed files with 4 additions and 2 deletions
|
|
@ -17,9 +17,11 @@ export default class EntriesService {
|
|||
const sorted =
|
||||
sort === "date" ? this._sortByDate(entries) : this._sortByTitle(entries, "title")
|
||||
|
||||
const sliced = sorted.slice(0, Number(limit) || -1)
|
||||
|
||||
return {
|
||||
count: entries.length,
|
||||
entries: sorted.slice(0, Number(limit) || -1),
|
||||
count: sliced.length,
|
||||
entries: sliced,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue