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 | f6b7a3c52126c1bc400001817d92e2e8729a8731 (patch) | |
tree | d5e81197c6fb1017e4fce86b24ce7351e711faae /api | |
parent | Add subscription plans so the client doesn't crash (diff) | |
download | server-f6b7a3c52126c1bc400001817d92e2e8729a8731.tar.xz |
:truck: rename id -> sku_id
Diffstat (limited to 'api')
-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; |