MCPcopy Index your code
hub / github.com/Peppermint-Lab/peppermint / timeTrackingRoutes

Function timeTrackingRoutes

apps/api/src/controllers/time.ts:4–32  ·  view source on GitHub ↗
(fastify: FastifyInstance)

Source from the content-addressed store, hash-verified

2import { prisma } from "../prisma";
3
4export function timeTrackingRoutes(fastify: FastifyInstance) {
5 // Create a new entry
6 fastify.post(
7 "/api/v1/time/new",
8
9 async (request: FastifyRequest, reply: FastifyReply) => {
10 const { time, ticket, title, user }: any = request.body;
11
12 console.log(request.body);
13
14 await prisma.timeTracking.create({
15 data: {
16 time: Number(time),
17 title,
18 userId: user,
19 ticketId: ticket,
20 },
21 });
22
23 reply.send({
24 success: true,
25 });
26 }
27 );
28
29 // Get all entries
30
31 // Delete an entry
32}

Callers 1

registerRoutesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected