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

export const reduxKey = "settingsCompany";

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

//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();
