* Add Whereby Boilerplate * Whereby App * around boilerplate * AroundCo App * Add Riverside App * Add Riverside to details * Fix URL validation * Remove Icons * Remove console.log * revert merge * Fix images * Update Iconds to be SVG * Add Disconnect button * Fix type * Fixing i18n merge * Refactor app installations * Update varient * Update default responder + riverside logo * Update apps/web/pages/event-types/[type].tsx Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Omar López <zomars@me.com>
26 lines
713 B
TypeScript
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);
|