aboutsummaryrefslogtreecommitdiff
path: root/api/src/modules/stats/stats.controller.ts
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/modules/stats/stats.controller.ts')
-rw-r--r--api/src/modules/stats/stats.controller.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/api/src/modules/stats/stats.controller.ts b/api/src/modules/stats/stats.controller.ts
new file mode 100644
index 0000000..520f692
--- /dev/null
+++ b/api/src/modules/stats/stats.controller.ts
@@ -0,0 +1,15 @@
+/**
+ * stats.controller.ts
+ * Lógica do dashboard.
+ */
+
+import type { FastifyReply, FastifyRequest } from 'fastify';
+import { getTicketsStats } from './stats.repository.js';
+
+export async function getStatsHandler(
+ request: FastifyRequest,
+ reply: FastifyReply,
+) {
+ const stats = await getTicketsStats(request.server.db);
+ return reply.send(stats);
+}