metaforecast/src/pages/api/questions.ts
Vyacheslav Matyukhin 066eb0302a
style: bring back double quotes from prettier
One large commit to avoid dealing with messy patches later on.
Turns out I had
https://marketplace.visualstudio.com/items?itemName=amatiasq.sort-imports
installed with single quotes which messed up all double quotes from
prettier.
2022-03-28 20:59:07 +03:00

14 lines
428 B
TypeScript

import { NextApiRequest, NextApiResponse } from "next/types";
import { pgRead } from "../../backend/database/pg-wrapper";
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
let allQuestions = await pgRead({ schema: "latest", tableName: "combined" });
console.log(allQuestions.map((element) => element.title).slice(0, 5));
console.log("...");
res.status(200).json(allQuestions);
}