jmou/yakatak
git clone https://github.com/jmou/yakatak.git
git clone git@github.com:jmou/yakatak.git
Loading…
(top)/app/server/api/getCards.post.ts
language: TypeScript
382 Bytes / 15 lines / 11 loc
History
View raw
// TODO this is not really a POST; replace with something better, like
// returning CardData with the session

interface Body {
  cardUids: string[];
}

export default defineEventHandler(async (event) => {
  const config = useRuntimeConfig(event);
  const db = await getDb(config.dbPath);

  const body = await readBody<Body>(event);

  return await db.getCards(body.cardUids);
});