import reduxCrud from 'lib/redux-crud';
import { fetchRequest, updateRequest } from 'lib/crud-backend';
import { settingsSelector } from 'utils/settings';

import { unitI18n } from "utils/settings";

export const reduxKey = "settingsTax";

//build API
let api = reduxCrud(reduxKey, { 
    fetchRequest: fetchRequest(({ unitId, id }) => `/api/${unitId}/settings/tax`),
    updateRequest: updateRequest(({ unitId, id }) => `/api/${unitId}/settings/tax`)
}); 

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

export const saveEntity = api.actions.saveEntity;

export const selector = api.selector;

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