mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
refactor: remove unused invoices state (#685)
This commit is contained in:
parent
fee1894c34
commit
9c2ac3e55b
@ -1,20 +0,0 @@
|
||||
import api from './api';
|
||||
import { dispatchError } from '../util';
|
||||
export const RECEIVE_INVOICES = 'RECEIVE_INVOICES';
|
||||
export const ERROR_FETCH_INVOICES = 'ERROR_FETCH_INVOICES';
|
||||
|
||||
const debug = require('debug')('unleash:e-admin-invoice-actions');
|
||||
|
||||
export function fetchInvoices() {
|
||||
debug('Start fetching invoices for hosted customer');
|
||||
return dispatch =>
|
||||
api
|
||||
.fetchAll()
|
||||
.then(value =>
|
||||
dispatch({
|
||||
type: RECEIVE_INVOICES,
|
||||
invoices: value.invoices,
|
||||
})
|
||||
)
|
||||
.catch(dispatchError(dispatch, ERROR_FETCH_INVOICES));
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
import { formatApiPath } from '../../utils/format-path';
|
||||
import { throwIfNotSuccess, headers } from '../api-helper';
|
||||
|
||||
const URI = formatApiPath('api/admin/invoices');
|
||||
|
||||
function fetchAll() {
|
||||
return fetch(URI, { headers, credentials: 'include' })
|
||||
.then(throwIfNotSuccess)
|
||||
.then(response => response.json());
|
||||
}
|
||||
|
||||
export default {
|
||||
fetchAll
|
||||
};
|
@ -1,13 +0,0 @@
|
||||
import { List } from 'immutable';
|
||||
import { RECEIVE_INVOICES } from './actions';
|
||||
|
||||
const store = (state = new List(), action) => {
|
||||
switch (action.type) {
|
||||
case RECEIVE_INVOICES:
|
||||
return new List(action.invoices);
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default store;
|
@ -14,7 +14,6 @@ import context from './context';
|
||||
import projects from './project';
|
||||
import addons from './addons';
|
||||
import apiCalls from './api-calls';
|
||||
import invoiceAdmin from './e-admin-invoice';
|
||||
import feedback from './feedback';
|
||||
|
||||
const unleashStore = combineReducers({
|
||||
@ -33,7 +32,6 @@ const unleashStore = combineReducers({
|
||||
projects,
|
||||
addons,
|
||||
apiCalls,
|
||||
invoiceAdmin,
|
||||
feedback,
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user