MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / handler

Function handler

apps/web/pages/api/invites/join.ts:12–37  ·  view source on GitHub ↗
(
  request: NextApiRequest,
  response: NextApiResponse
)

Source from the content-addressed store, hash-verified

10};
11
12export default async function handler(
13 request: NextApiRequest,
14 response: NextApiResponse
15) {
16 if (request.method === 'OPTIONS') {
17 return preflight(request, response, ['POST']);
18 }
19 cors(request, response);
20
21 const permissions = await PermissionsService.get({
22 request,
23 response,
24 params: {},
25 });
26 if (!permissions.auth?.email) {
27 return response.status(401).json({});
28 }
29
30 if (request.method === 'POST') {
31 const { inviteId }: PostProps = JSON.parse(request.body);
32 await acceptInvite(inviteId, permissions.auth?.email);
33 return response.status(200).json({});
34 }
35
36 return response.status(405).json({});
37}

Callers

nothing calls this directly

Calls 4

preflightFunction · 0.90
corsFunction · 0.90
acceptInviteFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected