1
0
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:
olav 2022-02-09 11:26:19 +01:00 committed by GitHub
parent fee1894c34
commit 9c2ac3e55b
4 changed files with 0 additions and 49 deletions

View File

@ -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));
}

View File

@ -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
};

View File

@ -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;

View File

@ -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,
});