From 3eba878943302ed9bd663e1c1bec4de6ac289689 Mon Sep 17 00:00:00 2001 From: chornos13 Date: Thu, 18 Feb 2021 12:01:52 +0700 Subject: [PATCH] refactor: move useUrlQuery to folder hooks --- src/data/useProfession.tsx | 2 +- src/{helpers/QueryUrl => hooks/useUrlQuery}/ArrayQuery.ts | 0 src/{helpers/QueryUrl => hooks/useUrlQuery}/QueryUrl.ts | 2 +- .../QueryUrl => hooks/useUrlQuery}/__test__/arrayQuery.test.ts | 2 +- .../QueryUrl => hooks/useUrlQuery}/__test__/queryUrl.test.ts | 2 +- src/{helpers/QueryUrl => hooks/useUrlQuery}/useUrlQuery.tsx | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename src/{helpers/QueryUrl => hooks/useUrlQuery}/ArrayQuery.ts (100%) rename src/{helpers/QueryUrl => hooks/useUrlQuery}/QueryUrl.ts (91%) rename src/{helpers/QueryUrl => hooks/useUrlQuery}/__test__/arrayQuery.test.ts (98%) rename src/{helpers/QueryUrl => hooks/useUrlQuery}/__test__/queryUrl.test.ts (92%) rename src/{helpers/QueryUrl => hooks/useUrlQuery}/useUrlQuery.tsx (96%) diff --git a/src/data/useProfession.tsx b/src/data/useProfession.tsx index f6d8157..531750e 100644 --- a/src/data/useProfession.tsx +++ b/src/data/useProfession.tsx @@ -1,6 +1,6 @@ import { useQuery, UseQueryOptions } from 'react-query' import ApiCall from 'services/ApiCall' -import useUrlQuery, { UseUrlQueryOptions } from 'helpers/QueryUrl/useUrlQuery' +import useUrlQuery, { UseUrlQueryOptions } from 'hooks/useUrlQuery/useUrlQuery' import { AxiosError } from 'axios' interface UseProfessionData { diff --git a/src/helpers/QueryUrl/ArrayQuery.ts b/src/hooks/useUrlQuery/ArrayQuery.ts similarity index 100% rename from src/helpers/QueryUrl/ArrayQuery.ts rename to src/hooks/useUrlQuery/ArrayQuery.ts diff --git a/src/helpers/QueryUrl/QueryUrl.ts b/src/hooks/useUrlQuery/QueryUrl.ts similarity index 91% rename from src/helpers/QueryUrl/QueryUrl.ts rename to src/hooks/useUrlQuery/QueryUrl.ts index f63f519..52b15d9 100644 --- a/src/helpers/QueryUrl/QueryUrl.ts +++ b/src/hooks/useUrlQuery/QueryUrl.ts @@ -1,4 +1,4 @@ -import ArrayQuery, { ArrayQueryOptions } from 'helpers/QueryUrl/ArrayQuery' +import ArrayQuery, { ArrayQueryOptions } from 'hooks/useUrlQuery/ArrayQuery' export interface QueryUrlOptions { filtered?: ArrayQueryOptions diff --git a/src/helpers/QueryUrl/__test__/arrayQuery.test.ts b/src/hooks/useUrlQuery/__test__/arrayQuery.test.ts similarity index 98% rename from src/helpers/QueryUrl/__test__/arrayQuery.test.ts rename to src/hooks/useUrlQuery/__test__/arrayQuery.test.ts index f470fc8..f56f712 100644 --- a/src/helpers/QueryUrl/__test__/arrayQuery.test.ts +++ b/src/hooks/useUrlQuery/__test__/arrayQuery.test.ts @@ -1,4 +1,4 @@ -import ArrayQuery from 'helpers/QueryUrl/ArrayQuery' +import ArrayQuery from 'hooks/useUrlQuery/ArrayQuery' describe('test basic function', () => { test('should set query', () => { diff --git a/src/helpers/QueryUrl/__test__/queryUrl.test.ts b/src/hooks/useUrlQuery/__test__/queryUrl.test.ts similarity index 92% rename from src/helpers/QueryUrl/__test__/queryUrl.test.ts rename to src/hooks/useUrlQuery/__test__/queryUrl.test.ts index 62bb7de..a552418 100644 --- a/src/helpers/QueryUrl/__test__/queryUrl.test.ts +++ b/src/hooks/useUrlQuery/__test__/queryUrl.test.ts @@ -1,4 +1,4 @@ -import QueryUrl from 'helpers/QueryUrl/QueryUrl' +import QueryUrl from 'hooks/useUrlQuery/QueryUrl' describe('test basic query url', () => { test('should add filtered', () => { diff --git a/src/helpers/QueryUrl/useUrlQuery.tsx b/src/hooks/useUrlQuery/useUrlQuery.tsx similarity index 96% rename from src/helpers/QueryUrl/useUrlQuery.tsx rename to src/hooks/useUrlQuery/useUrlQuery.tsx index 73d5e65..9634033 100644 --- a/src/helpers/QueryUrl/useUrlQuery.tsx +++ b/src/hooks/useUrlQuery/useUrlQuery.tsx @@ -1,4 +1,4 @@ -import QueryUrl, { QueryUrlOptions } from 'helpers/QueryUrl/QueryUrl' +import QueryUrl, { QueryUrlOptions } from 'hooks/useUrlQuery/QueryUrl' import { useMemo, useRef, useState } from 'react' import queryString from 'query-string' import _ from 'lodash'