From 811544d7dfb0442087e12c812d58b75a0d5052fc Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 22 Dec 2020 09:24:33 +0100 Subject: [PATCH] Moved api utils to subfolder --- src/api/{util.ts => utils/index.ts} | 2 +- src/short-urls/reducers/shortUrlCreation.ts | 2 +- src/short-urls/reducers/shortUrlDeletion.ts | 2 +- src/short-urls/reducers/shortUrlEdition.ts | 2 +- src/short-urls/reducers/shortUrlMeta.ts | 2 +- src/short-urls/reducers/shortUrlTags.ts | 2 +- src/tags/reducers/tagDelete.ts | 2 +- src/tags/reducers/tagEdit.ts | 2 +- src/tags/reducers/tagsList.ts | 2 +- src/visits/reducers/common.ts | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) rename src/api/{util.ts => utils/index.ts} (65%) diff --git a/src/api/util.ts b/src/api/utils/index.ts similarity index 65% rename from src/api/util.ts rename to src/api/utils/index.ts index 91901f1a..d13aded3 100644 --- a/src/api/util.ts +++ b/src/api/utils/index.ts @@ -1,4 +1,4 @@ import { AxiosError } from 'axios'; -import { ProblemDetailsError } from '../utils/services/types'; +import { ProblemDetailsError } from '../../utils/services/types'; export const parseApiError = (e: AxiosError) => e.response?.data; diff --git a/src/short-urls/reducers/shortUrlCreation.ts b/src/short-urls/reducers/shortUrlCreation.ts index e6f54cec..4d401ff8 100644 --- a/src/short-urls/reducers/shortUrlCreation.ts +++ b/src/short-urls/reducers/shortUrlCreation.ts @@ -4,7 +4,7 @@ import { ShortUrl, ShortUrlData } from '../data'; import { buildReducer, buildActionCreator } from '../../utils/helpers/redux'; import { ShlinkApiClientBuilder } from '../../utils/services/ShlinkApiClientBuilder'; import { ProblemDetailsError } from '../../utils/services/types'; -import { parseApiError } from '../../api/util'; +import { parseApiError } from '../../api/utils'; /* eslint-disable padding-line-between-statements */ export const CREATE_SHORT_URL_START = 'shlink/createShortUrl/CREATE_SHORT_URL_START'; diff --git a/src/short-urls/reducers/shortUrlDeletion.ts b/src/short-urls/reducers/shortUrlDeletion.ts index b4bf8966..bf458c1f 100644 --- a/src/short-urls/reducers/shortUrlDeletion.ts +++ b/src/short-urls/reducers/shortUrlDeletion.ts @@ -3,7 +3,7 @@ import { buildActionCreator, buildReducer } from '../../utils/helpers/redux'; import { ProblemDetailsError } from '../../utils/services/types'; import { GetState } from '../../container/types'; import { ShlinkApiClientBuilder } from '../../utils/services/ShlinkApiClientBuilder'; -import { parseApiError } from '../../api/util'; +import { parseApiError } from '../../api/utils'; /* eslint-disable padding-line-between-statements */ export const DELETE_SHORT_URL_START = 'shlink/deleteShortUrl/DELETE_SHORT_URL_START'; diff --git a/src/short-urls/reducers/shortUrlEdition.ts b/src/short-urls/reducers/shortUrlEdition.ts index 126b1287..ed2f3a10 100644 --- a/src/short-urls/reducers/shortUrlEdition.ts +++ b/src/short-urls/reducers/shortUrlEdition.ts @@ -5,7 +5,7 @@ import { OptionalString } from '../../utils/utils'; import { ShortUrlIdentifier } from '../data'; import { ShlinkApiClientBuilder } from '../../utils/services/ShlinkApiClientBuilder'; import { ProblemDetailsError } from '../../utils/services/types'; -import { parseApiError } from '../../api/util'; +import { parseApiError } from '../../api/utils'; /* eslint-disable padding-line-between-statements */ export const EDIT_SHORT_URL_START = 'shlink/shortUrlEdition/EDIT_SHORT_URL_START'; diff --git a/src/short-urls/reducers/shortUrlMeta.ts b/src/short-urls/reducers/shortUrlMeta.ts index dc55dbaa..fa10cb1c 100644 --- a/src/short-urls/reducers/shortUrlMeta.ts +++ b/src/short-urls/reducers/shortUrlMeta.ts @@ -5,7 +5,7 @@ import { buildActionCreator, buildReducer } from '../../utils/helpers/redux'; import { OptionalString } from '../../utils/utils'; import { ShlinkApiClientBuilder } from '../../utils/services/ShlinkApiClientBuilder'; import { ProblemDetailsError } from '../../utils/services/types'; -import { parseApiError } from '../../api/util'; +import { parseApiError } from '../../api/utils'; /* eslint-disable padding-line-between-statements */ export const EDIT_SHORT_URL_META_START = 'shlink/shortUrlMeta/EDIT_SHORT_URL_META_START'; diff --git a/src/short-urls/reducers/shortUrlTags.ts b/src/short-urls/reducers/shortUrlTags.ts index 6df90782..b2c9f704 100644 --- a/src/short-urls/reducers/shortUrlTags.ts +++ b/src/short-urls/reducers/shortUrlTags.ts @@ -5,7 +5,7 @@ import { OptionalString } from '../../utils/utils'; import { ShortUrlIdentifier } from '../data'; import { ShlinkApiClientBuilder } from '../../utils/services/ShlinkApiClientBuilder'; import { ProblemDetailsError } from '../../utils/services/types'; -import { parseApiError } from '../../api/util'; +import { parseApiError } from '../../api/utils'; /* eslint-disable padding-line-between-statements */ export const EDIT_SHORT_URL_TAGS_START = 'shlink/shortUrlTags/EDIT_SHORT_URL_TAGS_START'; diff --git a/src/tags/reducers/tagDelete.ts b/src/tags/reducers/tagDelete.ts index 4fb54621..63756a45 100644 --- a/src/tags/reducers/tagDelete.ts +++ b/src/tags/reducers/tagDelete.ts @@ -3,7 +3,7 @@ import { buildReducer } from '../../utils/helpers/redux'; import { GetState } from '../../container/types'; import { ShlinkApiClientBuilder } from '../../utils/services/ShlinkApiClientBuilder'; import { ProblemDetailsError } from '../../utils/services/types'; -import { parseApiError } from '../../api/util'; +import { parseApiError } from '../../api/utils'; /* eslint-disable padding-line-between-statements */ export const DELETE_TAG_START = 'shlink/deleteTag/DELETE_TAG_START'; diff --git a/src/tags/reducers/tagEdit.ts b/src/tags/reducers/tagEdit.ts index b6f1f964..15a4dae5 100644 --- a/src/tags/reducers/tagEdit.ts +++ b/src/tags/reducers/tagEdit.ts @@ -5,7 +5,7 @@ import { GetState } from '../../container/types'; import ColorGenerator from '../../utils/services/ColorGenerator'; import { ShlinkApiClientBuilder } from '../../utils/services/ShlinkApiClientBuilder'; import { ProblemDetailsError } from '../../utils/services/types'; -import { parseApiError } from '../../api/util'; +import { parseApiError } from '../../api/utils'; /* eslint-disable padding-line-between-statements */ export const EDIT_TAG_START = 'shlink/editTag/EDIT_TAG_START'; diff --git a/src/tags/reducers/tagsList.ts b/src/tags/reducers/tagsList.ts index 826d333f..452d28c4 100644 --- a/src/tags/reducers/tagsList.ts +++ b/src/tags/reducers/tagsList.ts @@ -9,7 +9,7 @@ import { TagStats } from '../data'; import { CreateVisit, Stats } from '../../visits/types'; import { DeleteTagAction, TAG_DELETED } from './tagDelete'; import { EditTagAction, TAG_EDITED } from './tagEdit'; -import { parseApiError } from '../../api/util'; +import { parseApiError } from '../../api/utils'; /* eslint-disable padding-line-between-statements */ export const LIST_TAGS_START = 'shlink/tagsList/LIST_TAGS_START'; diff --git a/src/visits/reducers/common.ts b/src/visits/reducers/common.ts index 765203c3..1bfa816a 100644 --- a/src/visits/reducers/common.ts +++ b/src/visits/reducers/common.ts @@ -2,7 +2,7 @@ import { flatten, prop, range, splitEvery } from 'ramda'; import { Action, Dispatch } from 'redux'; import { ShlinkPaginator, ShlinkVisits } from '../../utils/services/types'; import { Visit, VisitsLoadFailedAction } from '../types'; -import { parseApiError } from '../../api/util'; +import { parseApiError } from '../../api/utils'; const ITEMS_PER_PAGE = 5000; const PARALLEL_REQUESTS_COUNT = 4;