diff options
Diffstat (limited to 'src/hooks')
-rw-r--r-- | src/hooks/APIClient.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/hooks/APIClient.ts b/src/hooks/APIClient.ts index 015191c..c81b57d 100644 --- a/src/hooks/APIClient.ts +++ b/src/hooks/APIClient.ts @@ -1,6 +1,6 @@ import useSWR, { responseInterface } from 'swr'; import { get } from '../requests'; -import { User, Event } from '../types'; +import { User, Event, Log } from '../types'; type Response<T> = responseInterface<T, Error>; @@ -17,3 +17,7 @@ export const useEvents = (): Response<Event[]> => { return useSWR(`/events`, fetcher); }; +export const useEventLogs = (eventId: string): Response<Log[]> => { + return useSWR(`/logs?eventId=${eventId}`, fetcher); +}; + |