From ef742ea9b2f246f74eae74169675a331679ad41c Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 26 Mar 2021 01:56:04 +0300 Subject: feat: add strong typing where possible --- src/hooks/useAPIClient.ts | 22 ---------------------- src/hooks/useQuery.ts | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) (limited to 'src/hooks') diff --git a/src/hooks/useAPIClient.ts b/src/hooks/useAPIClient.ts index b523d1f..e992b42 100644 --- a/src/hooks/useAPIClient.ts +++ b/src/hooks/useAPIClient.ts @@ -28,28 +28,6 @@ const registerServiceHooks = (service: string): void => { hooks[service] = { useItem, useList }; }; -// Products -export interface Product { - _id: string; - name: string; - description: string; - price: number; - quantity: number; - specs: any; - createdAt: string; - updatedAt: string; -} - -// Contractors -export interface Contractor { - _id: string; - name: string; - fullName: string; - vatId: string; - type: string; - debt: number; -} - hooks.account = { useList: () => { const { data: transfers } = useSWR('/transfers', fetcher); diff --git a/src/hooks/useQuery.ts b/src/hooks/useQuery.ts index b2cb628..f025a46 100644 --- a/src/hooks/useQuery.ts +++ b/src/hooks/useQuery.ts @@ -1,6 +1,6 @@ import { useLocation } from 'react-router-dom'; -const useQuery = () => { +const useQuery = (): Record => { const location = useLocation(); const searchParams = new URLSearchParams(location.search); return Object.fromEntries(searchParams); -- cgit v1.2.3