diff --git a/backend/src/modules/timers/routes.ts b/backend/src/modules/timers/routes.ts index 0993bc2..4117853 100644 --- a/backend/src/modules/timers/routes.ts +++ b/backend/src/modules/timers/routes.ts @@ -11,6 +11,7 @@ */ import type { FastifyInstance } from 'fastify'; +import { getEventBus } from '../../lib/event-bus.js'; import { BadRequestError, NotFoundError, ConflictError } from '@bytelyst/errors'; import { extractAuth } from '../../lib/auth.js'; import * as repo from './repository.js'; @@ -106,6 +107,7 @@ export async function timerRoutes(app: FastifyInstance) { req.log.info({ timerId: doc.id, type: doc.type }, 'Creating timer'); const created = await repo.createTimer(doc); + getEventBus().emit('timer.created', { timerId: doc.id, userId: auth.sub, label: doc.label }); reply.code(201); return created; });