diff options
author | eug-vs <eug-vs@keemail.me> | 2020-11-29 16:26:00 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-11-29 16:26:00 +0300 |
commit | 3836f103ff40637e48c04eae9968b008e524294f (patch) | |
tree | adf73ec68b835ec6952f1d88671844302e2a44db /src/hooks | |
parent | b91bbecb1be55b96f92eaca6f4bb8d33982b0834 (diff) | |
download | famcs-kit-3836f103ff40637e48c04eae9968b008e524294f.tar.gz |
feat: add Logs to EventCard
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); +}; + |