refactor main view to table and add production, import and export information per planet

This commit is contained in:
Calli
2023-07-16 19:02:11 +03:00
parent bc0c2f83a2
commit 4c392533da
11 changed files with 1906 additions and 15 deletions

21
src/pages/api/praisal.ts Normal file
View File

@@ -0,0 +1,21 @@
import { getPraisal } from "@/eve-praisal";
import { NextApiRequest, NextApiResponse } from "next";
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
if (req.method === "POST") {
const praisalRequest: { quantity: number; type_id: number }[] = JSON.parse(
req.body
);
try {
const praisal = await getPraisal(praisalRequest);
return res.json(praisal);
} catch (e) {
console.log(e);
res.status(404).end();
}
} else {
res.status(404).end();
}
};
export default handler;