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 = "settingsLinkedAccounts";

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

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

export const selector = settingsSelector(api.selector);

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