TreeTable component seems to work too. Edit is half-way through. Create / delete are TBD.
18 lines
846 B
JavaScript
18 lines
846 B
JavaScript
'use strict';
|
|
|
|
import csfrToken from 'csfrToken';
|
|
import axios from 'axios';
|
|
import interoperableErrors from '../../../shared/interoperable-errors';
|
|
|
|
const axiosInst = axios.create({
|
|
headers: {'X-CSRF-TOKEN': csfrToken}
|
|
});
|
|
|
|
const axiosWrapper = {
|
|
get: (...args) => axiosInst.get(...args).catch(error => { throw interoperableErrors.deserialize(error.response.data) || error }),
|
|
put: (...args) => axiosInst.put(...args).catch(error => { throw interoperableErrors.deserialize(error.response.data) || error }),
|
|
post: (...args) => axiosInst.post(...args).catch(error => { throw interoperableErrors.deserialize(error.response.data) || error }),
|
|
delete: (...args) => axiosInst.delete(...args).catch(error => { throw interoperableErrors.deserialize(error.response.data) || error })
|
|
};
|
|
|
|
export default axiosWrapper;
|