1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 05:02:37 +01:00

🚚 rename id -> sku_id

This commit is contained in:
Flam3rboy 2021-10-03 23:32:10 +02:00
parent 5116dcf2e8
commit 844911b9ee

View File

@ -11,31 +11,15 @@ const skus = new Map([
]); ]);
router.get("/", route({}), async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {
//TODO // TODO: add the ability to add custom
const { id } = req.params; const { sku_id } = req.params;
if(!skus.has(id.toString())) { if(!skus.has(sku_id)) {
console.log(`Request for invalid SKU ${id}! Please report this!`); console.log(`Request for invalid SKU ${sku_id}! Please report this!`);
res.sendStatus(404); res.sendStatus(404);
} else {
res.json(skus.get(sku_id)).status(200);
} }
else {
res.json(skus.get(id.toString())).status(200);
}
// res.json([
// {
// id: "",
// name: "",
// interval: 1,
// interval_count: 1,
// tax_inclusive: true,
// sku_id: "",
// fallback_price: 499,
// fallback_currency: "eur",
// currency: "eur",
// price: 4199,
// price_tier: null
// }]).status(200);
}); });
export default router; export default router;