(fastify)
| 4 | import { isBotHook } from '@/hooks/is-bot.hook'; |
| 5 | |
| 6 | const 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 | |
| 41 | export default profileRouter; |
nothing calls this directly
no outgoing calls
no test coverage detected