mirror of
https://github.com/calli-eve/eve-pi.git
synced 2026-02-14 19:58:48 +01:00
refactor main view to table and add production, import and export information per planet
This commit is contained in:
21
src/pages/api/praisal.ts
Normal file
21
src/pages/api/praisal.ts
Normal 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;
|
||||
Reference in New Issue
Block a user