From 3836f103ff40637e48c04eae9968b008e524294f Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 29 Nov 2020 16:26:00 +0300 Subject: feat: add Logs to EventCard --- src/hooks/APIClient.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/hooks/APIClient.ts') 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 = responseInterface; @@ -17,3 +17,7 @@ export const useEvents = (): Response => { return useSWR(`/events`, fetcher); }; +export const useEventLogs = (eventId: string): Response => { + return useSWR(`/logs?eventId=${eventId}`, fetcher); +}; + -- cgit v1.2.3