import reduxList from 'lib/redux-list';
import { listRequest, listResponse } from 'lib/list-backend';
import { settingsSelector } from 'utils/settings';

//build API
let api = reduxList('paymentCategoryList', { 
	fetchRequest: listRequest(({ unitId }) => `/api/${unitId}/payments/categories`),
	fetchResponse: listResponse()
}); 

//export actions
export const fetchList = api.actions.fetchList;

//unit selector
export const selector = settingsSelector(api.selector);


//export reducer
export default api.reducer.export();
