feat: return count of Entries for get all
This commit is contained in:
parent
672987a2fa
commit
eb42c87a6e
1 changed files with 3 additions and 4 deletions
|
|
@ -18,10 +18,9 @@ export default class EntriesService {
|
|||
.all()
|
||||
.slice(0, Number(limit) || -1)
|
||||
|
||||
if (sort === "date") {
|
||||
return sortByDate(entries)
|
||||
}
|
||||
|
||||
return sortByTitle(entries)
|
||||
return {
|
||||
count: entries.length,
|
||||
entries: sort === "date" ? sortByDate(entries) : sortByTitle(entries),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue