From 24899b40e08d0276b16d03efb215d7683b64d1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Wed, 6 Jan 2021 22:19:50 +0100 Subject: [PATCH] fix: move all api calls to store folders --- frontend/src/{data/helper.js => store/api-helper.js} | 0 frontend/src/store/application/actions.js | 2 +- .../{data/applications-api.js => store/application/api.js} | 2 +- frontend/src/store/archive/actions.js | 2 +- frontend/src/{data/archive-api.js => store/archive/api.js} | 2 +- frontend/src/store/context/actions.js | 2 +- frontend/src/{data/context-api.js => store/context/api.js} | 2 +- frontend/src/store/feature-metrics/actions.js | 2 +- .../feature-metrics-api.js => store/feature-metrics/api.js} | 2 +- frontend/src/store/feature-toggle/actions.js | 2 +- .../src/{data/feature-api.js => store/feature-toggle/api.js} | 2 +- frontend/src/store/feature-type/actions.js | 2 +- .../{data/feature-type-api.js => store/feature-type/api.js} | 2 +- frontend/src/store/history/actions.js | 2 +- frontend/src/{data/history-api.js => store/history/api.js} | 2 +- frontend/src/store/project/actions.js | 2 +- frontend/src/{data/project-api.js => store/project/api.js} | 2 +- frontend/src/store/strategy/actions.js | 4 ++-- frontend/src/{data/strategy-api.js => store/strategy/api.js} | 2 +- frontend/src/store/ui-config/actions.js | 2 +- frontend/src/{data/config-api.js => store/ui-config/api.js} | 2 +- frontend/src/store/user/actions.js | 2 +- frontend/src/{data/user-api.js => store/user/api.js} | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) rename frontend/src/{data/helper.js => store/api-helper.js} (100%) rename frontend/src/{data/applications-api.js => store/application/api.js} (95%) rename frontend/src/{data/archive-api.js => store/archive/api.js} (87%) rename frontend/src/{data/context-api.js => store/context/api.js} (94%) rename frontend/src/{data/feature-metrics-api.js => store/feature-metrics/api.js} (90%) rename frontend/src/{data/feature-api.js => store/feature-toggle/api.js} (97%) rename frontend/src/{data/feature-type-api.js => store/feature-type/api.js} (81%) rename frontend/src/{data/history-api.js => store/history/api.js} (89%) rename frontend/src/{data/project-api.js => store/project/api.js} (94%) rename frontend/src/{data/strategy-api.js => store/strategy/api.js} (93%) rename frontend/src/{data/config-api.js => store/ui-config/api.js} (81%) rename frontend/src/{data/user-api.js => store/user/api.js} (93%) diff --git a/frontend/src/data/helper.js b/frontend/src/store/api-helper.js similarity index 100% rename from frontend/src/data/helper.js rename to frontend/src/store/api-helper.js diff --git a/frontend/src/store/application/actions.js b/frontend/src/store/application/actions.js index f8d1afff9a..28ad3e67f4 100644 --- a/frontend/src/store/application/actions.js +++ b/frontend/src/store/application/actions.js @@ -1,4 +1,4 @@ -import api from '../../data/applications-api'; +import api from './api'; import { dispatchAndThrow } from '../util'; import { MUTE_ERROR } from '../error/actions'; diff --git a/frontend/src/data/applications-api.js b/frontend/src/store/application/api.js similarity index 95% rename from frontend/src/data/applications-api.js rename to frontend/src/store/application/api.js index 5a4e3e1554..8b799baab7 100644 --- a/frontend/src/data/applications-api.js +++ b/frontend/src/store/application/api.js @@ -1,4 +1,4 @@ -import { throwIfNotSuccess, headers } from './helper'; +import { throwIfNotSuccess, headers } from '../api-helper'; const URI = 'api/admin/metrics/applications'; diff --git a/frontend/src/store/archive/actions.js b/frontend/src/store/archive/actions.js index 2ba048387c..08692c14b5 100644 --- a/frontend/src/store/archive/actions.js +++ b/frontend/src/store/archive/actions.js @@ -1,4 +1,4 @@ -import api from '../../data/archive-api'; +import api from './api'; import { dispatchAndThrow } from '../util'; export const REVIVE_TOGGLE = 'REVIVE_TOGGLE'; diff --git a/frontend/src/data/archive-api.js b/frontend/src/store/archive/api.js similarity index 87% rename from frontend/src/data/archive-api.js rename to frontend/src/store/archive/api.js index bcfdd28557..2741110e21 100644 --- a/frontend/src/data/archive-api.js +++ b/frontend/src/store/archive/api.js @@ -1,4 +1,4 @@ -import { throwIfNotSuccess, headers } from './helper'; +import { throwIfNotSuccess, headers } from '../api-helper'; const URI = 'api/admin/archive'; diff --git a/frontend/src/store/context/actions.js b/frontend/src/store/context/actions.js index 38fb03dc6e..deab34ee75 100644 --- a/frontend/src/store/context/actions.js +++ b/frontend/src/store/context/actions.js @@ -1,4 +1,4 @@ -import api from '../../data/context-api'; +import api from './api'; import { dispatchAndThrow } from '../util'; export const RECEIVE_CONTEXT = 'RECEIVE_CONTEXT'; diff --git a/frontend/src/data/context-api.js b/frontend/src/store/context/api.js similarity index 94% rename from frontend/src/data/context-api.js rename to frontend/src/store/context/api.js index a06b9b16a4..2631b679ac 100644 --- a/frontend/src/data/context-api.js +++ b/frontend/src/store/context/api.js @@ -1,4 +1,4 @@ -import { throwIfNotSuccess, headers } from './helper'; +import { throwIfNotSuccess, headers } from '../api-helper'; const URI = 'api/admin/context'; diff --git a/frontend/src/store/feature-metrics/actions.js b/frontend/src/store/feature-metrics/actions.js index 1a6405576b..bcf35ea736 100644 --- a/frontend/src/store/feature-metrics/actions.js +++ b/frontend/src/store/feature-metrics/actions.js @@ -1,4 +1,4 @@ -import api from '../../data/feature-metrics-api'; +import api from './api'; export const START_FETCH_FEATURE_METRICS = 'START_FETCH_FEATURE_METRICS'; export const RECEIVE_FEATURE_METRICS = 'RECEIVE_FEATURE_METRICS'; diff --git a/frontend/src/data/feature-metrics-api.js b/frontend/src/store/feature-metrics/api.js similarity index 90% rename from frontend/src/data/feature-metrics-api.js rename to frontend/src/store/feature-metrics/api.js index 8ac691e9cb..69c187fac6 100644 --- a/frontend/src/data/feature-metrics-api.js +++ b/frontend/src/store/feature-metrics/api.js @@ -1,4 +1,4 @@ -import { throwIfNotSuccess } from './helper'; +import { throwIfNotSuccess } from '../api-helper'; const URI = 'api/admin/metrics/feature-toggles'; diff --git a/frontend/src/store/feature-toggle/actions.js b/frontend/src/store/feature-toggle/actions.js index 9d20905235..f255ecbd29 100644 --- a/frontend/src/store/feature-toggle/actions.js +++ b/frontend/src/store/feature-toggle/actions.js @@ -1,4 +1,4 @@ -import api from '../../data/feature-api'; +import api from './api'; const debug = require('debug')('unleash:feature-actions'); import { dispatchAndThrow } from '../util'; import { MUTE_ERROR } from '../error/actions'; diff --git a/frontend/src/data/feature-api.js b/frontend/src/store/feature-toggle/api.js similarity index 97% rename from frontend/src/data/feature-api.js rename to frontend/src/store/feature-toggle/api.js index 185fc02cf3..e7e54f5452 100644 --- a/frontend/src/data/feature-api.js +++ b/frontend/src/store/feature-toggle/api.js @@ -1,4 +1,4 @@ -import { throwIfNotSuccess, headers } from './helper'; +import { throwIfNotSuccess, headers } from '../api-helper'; const URI = 'api/admin/features'; diff --git a/frontend/src/store/feature-type/actions.js b/frontend/src/store/feature-type/actions.js index 04eaaeae75..c8d0c7f311 100644 --- a/frontend/src/store/feature-type/actions.js +++ b/frontend/src/store/feature-type/actions.js @@ -1,4 +1,4 @@ -import api from '../../data/feature-type-api'; +import api from './api'; import { dispatchAndThrow } from '../util'; export const RECEIVE_FEATURE_TYPES = 'RECEIVE_FEATURE_TYPES'; diff --git a/frontend/src/data/feature-type-api.js b/frontend/src/store/feature-type/api.js similarity index 81% rename from frontend/src/data/feature-type-api.js rename to frontend/src/store/feature-type/api.js index 9bc5da1b33..22e39509fb 100644 --- a/frontend/src/data/feature-type-api.js +++ b/frontend/src/store/feature-type/api.js @@ -1,4 +1,4 @@ -import { throwIfNotSuccess } from './helper'; +import { throwIfNotSuccess } from '../api-helper'; const URI = 'api/admin/feature-types'; diff --git a/frontend/src/store/history/actions.js b/frontend/src/store/history/actions.js index 9207ee5aaa..64644e1a8c 100644 --- a/frontend/src/store/history/actions.js +++ b/frontend/src/store/history/actions.js @@ -1,4 +1,4 @@ -import api from '../../data/history-api'; +import api from './api'; import { dispatchAndThrow } from '../util'; export const RECEIVE_HISTORY = 'RECEIVE_HISTORY'; diff --git a/frontend/src/data/history-api.js b/frontend/src/store/history/api.js similarity index 89% rename from frontend/src/data/history-api.js rename to frontend/src/store/history/api.js index 7a72bf09de..a2b535908a 100644 --- a/frontend/src/data/history-api.js +++ b/frontend/src/store/history/api.js @@ -1,4 +1,4 @@ -import { throwIfNotSuccess } from './helper'; +import { throwIfNotSuccess } from '../api-helper'; const URI = 'api/admin/events'; diff --git a/frontend/src/store/project/actions.js b/frontend/src/store/project/actions.js index 16863b3b41..d82050144a 100644 --- a/frontend/src/store/project/actions.js +++ b/frontend/src/store/project/actions.js @@ -1,4 +1,4 @@ -import api from '../../data/project-api'; +import api from './api'; import { dispatchAndThrow } from '../util'; export const RECEIVE_PROJECT = 'RECEIVE_PROJECT'; diff --git a/frontend/src/data/project-api.js b/frontend/src/store/project/api.js similarity index 94% rename from frontend/src/data/project-api.js rename to frontend/src/store/project/api.js index 6212b06c72..ea76671c1f 100644 --- a/frontend/src/data/project-api.js +++ b/frontend/src/store/project/api.js @@ -1,4 +1,4 @@ -import { throwIfNotSuccess, headers } from './helper'; +import { throwIfNotSuccess, headers } from '../api-helper'; const URI = 'api/admin/projects'; diff --git a/frontend/src/store/strategy/actions.js b/frontend/src/store/strategy/actions.js index 26e06d18d4..68aa55ff00 100644 --- a/frontend/src/store/strategy/actions.js +++ b/frontend/src/store/strategy/actions.js @@ -1,5 +1,5 @@ -import api from '../../data/strategy-api'; -import applicationApi from '../../data/applications-api'; +import api from './api'; +import applicationApi from '../application/api'; import { dispatchAndThrow } from '../util'; export const ADD_STRATEGY = 'ADD_STRATEGY'; diff --git a/frontend/src/data/strategy-api.js b/frontend/src/store/strategy/api.js similarity index 93% rename from frontend/src/data/strategy-api.js rename to frontend/src/store/strategy/api.js index 16647ede0d..8a3553154f 100644 --- a/frontend/src/data/strategy-api.js +++ b/frontend/src/store/strategy/api.js @@ -1,4 +1,4 @@ -import { throwIfNotSuccess, headers } from './helper'; +import { throwIfNotSuccess, headers } from '../api-helper'; const URI = 'api/admin/strategies'; diff --git a/frontend/src/store/ui-config/actions.js b/frontend/src/store/ui-config/actions.js index a7979d6ced..7a44126e80 100644 --- a/frontend/src/store/ui-config/actions.js +++ b/frontend/src/store/ui-config/actions.js @@ -1,4 +1,4 @@ -import api from '../../data/config-api'; +import api from './api'; import { dispatchAndThrow } from '../util'; export const RECEIVE_CONFIG = 'RECEIVE_CONFIG'; diff --git a/frontend/src/data/config-api.js b/frontend/src/store/ui-config/api.js similarity index 81% rename from frontend/src/data/config-api.js rename to frontend/src/store/ui-config/api.js index 2879e62361..153916f78c 100644 --- a/frontend/src/data/config-api.js +++ b/frontend/src/store/ui-config/api.js @@ -1,4 +1,4 @@ -import { throwIfNotSuccess } from './helper'; +import { throwIfNotSuccess } from '../api-helper'; const URI = 'api/admin/ui-config'; diff --git a/frontend/src/store/user/actions.js b/frontend/src/store/user/actions.js index 949562dcc9..5068d0eedb 100644 --- a/frontend/src/store/user/actions.js +++ b/frontend/src/store/user/actions.js @@ -1,4 +1,4 @@ -import api from '../../data/user-api'; +import api from './api'; import { dispatchAndThrow } from '../util'; export const UPDATE_USER = 'UPDATE_USER'; export const USER_LOGOUT = 'USER_LOGOUT'; diff --git a/frontend/src/data/user-api.js b/frontend/src/store/user/api.js similarity index 93% rename from frontend/src/data/user-api.js rename to frontend/src/store/user/api.js index e3257d75d8..a9880f7222 100644 --- a/frontend/src/data/user-api.js +++ b/frontend/src/store/user/api.js @@ -1,4 +1,4 @@ -import { throwIfNotSuccess, headers } from './helper'; +import { throwIfNotSuccess, headers } from '../api-helper'; const URI = 'api/admin/user';