Files
calendar/packages/app-store/ping/api/_getAdd.ts
T
1332b76441 added ping.gg app (#3728)
* added ping.gg app, not sure why its not showing

* nit

* Fixes

* fixed email

Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
2022-08-08 05:57:09 +00:00

26 lines
713 B
TypeScript

import type { NextApiRequest, NextApiResponse } from "next";
import { defaultResponder } from "@calcom/lib/server";
import checkSession from "../../_utils/auth";
import { checkInstalled, createDefaultInstallation } from "../../_utils/installation";
import appConfig from "../config.json";
export async function getHandler(req: NextApiRequest, res: NextApiResponse) {
const session = checkSession(req);
const slug = appConfig.slug;
const appType = appConfig.type;
await checkInstalled(slug, session.user.id);
await createDefaultInstallation({
appType,
userId: session.user.id,
slug,
key: {},
});
return { url: "/apps/installed" };
}
export default defaultResponder(getHandler);