diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-03 23:32:10 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-03 23:32:10 +0200 |
commit | 844911b9eef2379583321fe0c1bebaec61a7a19f (patch) | |
tree | a49a7d2d7c4532fe9f9661f07f94331a83fa4d30 /api/src/routes | |
parent | Add subscription plans so the client doesn't crash (diff) | |
download | server-844911b9eef2379583321fe0c1bebaec61a7a19f.tar.xz |
:truck: rename id -> sku_id
Diffstat (limited to 'api/src/routes')
-rw-r--r-- | api/src/routes/store/published-listings/skus/#sku_id/subscription-plans.ts (renamed from api/src/routes/store/published-listings/skus/#id/subscription-plans.ts) | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/api/src/routes/store/published-listings/skus/#id/subscription-plans.ts b/api/src/routes/store/published-listings/skus/#sku_id/subscription-plans.ts index 49bb0aa3..54c01607 100644 --- a/api/src/routes/store/published-listings/skus/#id/subscription-plans.ts +++ b/api/src/routes/store/published-listings/skus/#sku_id/subscription-plans.ts @@ -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; |