aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-08-15 05:04:26 +0300
committereug-vs <eug-vs@keemail.me>2020-08-15 05:04:26 +0300
commitf2ad02d1f2aa5acaac430148dadfd2abc9e671e0 (patch)
tree03d0e2805613def1197011c521cc2002e2b88701 /src
parent3605a00b1399c4305ed54b65e500d8cfad35f5a7 (diff)
downloadwhich-ui-f2ad02d1f2aa5acaac430148dadfd2abc9e671e0.tar.gz
refactor: get rid of unnecessary types
Diffstat (limited to 'src')
-rw-r--r--src/hooks/APIClient.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hooks/APIClient.ts b/src/hooks/APIClient.ts
index f66ef2e..cf5d247 100644
--- a/src/hooks/APIClient.ts
+++ b/src/hooks/APIClient.ts
@@ -10,17 +10,17 @@ export const useUser = (username: string | null): Response<User> => {
return useSWR(
username && `/users?username=${username}`,
(url: string) => get(url).then(response => response.data[0])
- ) as Response<User>;
+ );
};
export const useProfile = (id: string): Response<Poll[]> => {
- return useSWR(id && `/profiles/${id}`, fetcher) as Response<Poll[]>;
+ return useSWR(id && `/profiles/${id}`, fetcher);
};
export const useFeed = (): Response<Poll[]> => {
- return useSWR('/feed', fetcher, { revalidateOnFocus: false }) as Response<Poll[]>;
+ return useSWR('/feed', fetcher, { revalidateOnFocus: false });
};
export const useFeedback = (): Response<Feedback[]> => {
- return useSWR('/feedback', fetcher) as Response<Feedback[]>;
+ return useSWR('/feedback', fetcher);
};