Get API file
import { apiUrl } from '../config'
const baseUri = apiUrl
const uri = {
outline : '/course/income/outline'
}
const getURI = (key) => baseUri + uri[key]
module.exports = { apiMiddleware, get, post, put, ...{ delete: del }, uri, getURI }
Try pass this to my axios URL
import Api from '../middleware/api'
export function IncomeList () {
return dispatch => {
return (
axios.post(Api.getURI(outline),{}, {
headers: { 'X-Authenticated-Userid': '15000500000@1' }
}).then(function (response) {
console.log(response.data);
dispatch(receiveData(response.data.body));
})
.catch((error) => {
console.log(error);
})
)
}
}
But I get error Uncaught ReferenceError: outline is not defined. How to Pass correct URL ?