Skip to content

Commit

Permalink
Renamed test to symbolic'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomohiro-sawada committed Oct 9, 2023
1 parent 3ac0259 commit 2d80908
Show file tree
Hide file tree
Showing 56 changed files with 33 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions src/pages/api/trash/lib/law/[id].ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { findLawProblemById } from "../../../../server/mongodb/actions/lawProblem";
import requestWrapper from "../../../../server/utils/middleware";

async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== "GET") {
res.status(405).end();
return;
}
const { id } = req.query;
const problem = await findLawProblemById(id);

const formattedResponse = JSON.stringify(problem, null, 2);

res.setHeader("Content-Type", "application/json");
res.status(200).send(formattedResponse);
}

export default requestWrapper(handler, "GET");
14 changes: 14 additions & 0 deletions src/pages/api/trash/lib/law/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { getAllLawProblems } from "../../../../server/mongodb/actions/lawProblem";
import requestWrapper from "../../../../server/utils/middleware";

async function handler(req: NextApiRequest, res: NextApiResponse) {
const allProblems = await getAllLawProblems();

const formattedResponse = JSON.stringify(allProblems, null, 2);

res.setHeader("Content-Type", "application/json");
res.status(200).send(formattedResponse);
}

export default requestWrapper(handler, "GET");
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2d80908

Please sign in to comment.