CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/pages/api/v2/purchases/get-service-cost.ts
Views: 687
1
/*
2
Let user get all of their purchase quotas.
3
*/
4
5
import getParams from "lib/api/get-params";
6
import getServiceCost from "@cocalc/server/purchases/get-service-cost";
7
8
export default async function handle(req, res) {
9
try {
10
res.json(await get(req));
11
} catch (err) {
12
res.json({ error: `${err.message}` });
13
return;
14
}
15
}
16
17
async function get(req) {
18
const { service } = getParams(req);
19
return await getServiceCost(service);
20
}
21
22