MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / profileRouter

Function profileRouter

apps/api/src/routes/profile.router.ts:6–39  ·  view source on GitHub ↗
(fastify)

Source from the content-addressed store, hash-verified

4import { isBotHook } from '@/hooks/is-bot.hook';
5
6const profileRouter: FastifyPluginAsyncZodOpenApi = async (fastify) => {
7 fastify.addHook('preHandler', clientHook);
8 fastify.addHook('preHandler', isBotHook);
9
10 fastify.route({
11 method: 'POST',
12 url: '/',
13 schema: {
14 tags: ['Profile'],
15 description: 'Identify or update a user profile.',
16 },
17 handler: controller.updateProfile,
18 });
19
20 fastify.route({
21 method: 'POST',
22 url: '/increment',
23 schema: {
24 tags: ['Profile'],
25 description: 'Increment a numeric property on a user profile.',
26 },
27 handler: controller.incrementProfileProperty,
28 });
29
30 fastify.route({
31 method: 'POST',
32 url: '/decrement',
33 schema: {
34 tags: ['Profile'],
35 description: 'Decrement a numeric property on a user profile.',
36 },
37 handler: controller.decrementProfileProperty,
38 });
39};
40
41export default profileRouter;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected