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.
14 lines
428 B
TypeScript
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);
|
|
}
|