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/support/create-ticket.ts
Views: 687
1
/*
2
Create a support ticket.
3
*/
4
5
import createSupportTicket from "@cocalc/server/support/create-ticket";
6
import getAccountId from "lib/account/get-account";
7
import getParams from "lib/api/get-params";
8
9
export default async function handle(req, res) {
10
const { options } = getParams(req);
11
12
let url;
13
try {
14
const account_id = await getAccountId(req);
15
url = await createSupportTicket({ ...options, account_id });
16
} catch (err) {
17
res.json({ error: `${err.message}` });
18
return;
19
}
20
res.json({ url });
21
}
22
23