feat: return count of Entries for get all

This commit is contained in:
Thomas Bishop 2025-07-14 17:46:08 +01:00
parent 672987a2fa
commit eb42c87a6e

View file

@ -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),
}
}
}