From d7ed01d5543a06e3ee37406b51ad6002e4eb3aee Mon Sep 17 00:00:00 2001 From: Jacob Hagstedt Date: Thu, 25 Jun 2026 09:52:25 +0200 Subject: [PATCH] Fix build? --- frontend/src/hooks/useSleepSession.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/hooks/useSleepSession.ts b/frontend/src/hooks/useSleepSession.ts index a64c7d3..b910402 100644 --- a/frontend/src/hooks/useSleepSession.ts +++ b/frontend/src/hooks/useSleepSession.ts @@ -1,6 +1,6 @@ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { fetchActiveSession, createSession, endSession, fetchSessions, deleteSession, updateSession } from '../api/client'; -import type { SleepSessionRead } from '../types'; +import type { SleepSessionRead, SleepSessionCreate } from '../types'; export function useSleepSession() { const queryClient = useQueryClient(); @@ -12,7 +12,7 @@ export function useSleepSession() { }); const createMutation = useMutation({ - mutationFn: (args) => createSession(args), + mutationFn: (args: SleepSessionCreate) => createSession(args), onSuccess: () => { queryClient.invalidateQueries({ queryKey: ['activeSession'] }); queryClient.invalidateQueries({ queryKey: ['sessions'] }); @@ -20,7 +20,7 @@ export function useSleepSession() { }); const endMutation = useMutation({ - mutationFn: (args) => endSession(args.sessionId, { end_time: args.endTime }), + mutationFn: (args: { sessionId: number; endTime: string }) => endSession(args.sessionId, { end_time: args.endTime }), onSuccess: () => { queryClient.invalidateQueries({ queryKey: ['activeSession'] }); queryClient.invalidateQueries({ queryKey: ['sessions'] }); @@ -47,7 +47,7 @@ export function useSessions() { }); const deleteMutation = useMutation({ - mutationFn: (id) => deleteSession(id), + mutationFn: (id: number) => deleteSession(id), onSuccess: () => { queryClient.invalidateQueries({ queryKey: ['sessions'] }); },