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 =
|
const sorted =
|
||||||
sort === "date" ? this._sortByDate(entries) : this._sortByTitle(entries, "title")
|
sort === "date" ? this._sortByDate(entries) : this._sortByTitle(entries, "title")
|
||||||
|
|
||||||
|
const sliced = sorted.slice(0, Number(limit) || -1)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
count: entries.length,
|
count: sliced.length,
|
||||||
entries: sorted.slice(0, Number(limit) || -1),
|
entries: sliced,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue