diff --git a/server/internal/clients/event-handler.ts b/server/internal/clients/event-handler.ts index a355320..0e0d9a4 100644 --- a/server/internal/clients/event-handler.ts +++ b/server/internal/clients/event-handler.ts @@ -5,7 +5,7 @@ import prisma from "../db/database"; export type EventHandlerFunction = ( h3: H3Event, - utils: ClientUtils, + utils: ClientUtils ) => Promise | T; type ClientUtils = { @@ -82,7 +82,7 @@ export function defineClientEventHandler(handler: EventHandlerFunction) { }); if (!client) throw new Error( - "client util fetch client broke - this should NOT happen", + "client util fetch client broke - this should NOT happen" ); return client; } @@ -97,7 +97,7 @@ export function defineClientEventHandler(handler: EventHandlerFunction) { if (!client) throw new Error( - "client util fetch client broke - this should NOT happen", + "client util fetch client broke - this should NOT happen" ); return client.user; @@ -109,6 +109,11 @@ export function defineClientEventHandler(handler: EventHandlerFunction) { fetchUser, }; + prisma.client.update({ + where: { id: clientId }, + data: { lastConnected: new Date() }, + }); + return await handler(h3, utils); }); }