1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 20:52:42 +01:00

🚚 rename id -> sku_id

This commit is contained in:
Flam3rboy 2021-10-03 23:32:10 +02:00
parent c99360be2a
commit f6b7a3c521

View File

@ -11,31 +11,15 @@ const skus = new Map([
]);
router.get("/", route({}), async (req: Request, res: Response) => {
//TODO
const { id } = req.params;
// TODO: add the ability to add custom
const { sku_id } = req.params;
if(!skus.has(id.toString())) {
console.log(`Request for invalid SKU ${id}! Please report this!`);
if(!skus.has(sku_id)) {
console.log(`Request for invalid SKU ${sku_id}! Please report this!`);
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;