feat(api): add endpoint to fetch latest stories

This commit is contained in:
parent c27c81f39c
commit b5454e9363
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

11
server/api/latest.get.ts Normal file

@ -0,0 +1,11 @@
import listQuerier from "~/lib/server/dbHelpers/listQuerier";
import { Story } from "~/models/stories";
import { log } from "~/lib/server/logger";
export default eventHandler(async (ev) => {
const s = await listQuerier({}, ev.context, ev, 20, {
"chapters.posted": -1,
});
log.debug("s=>", { label: "fucking aids" });
return s;
});