UNPKG

refine-jsonapi

Version:

Data provider for refine with JSON:API specification. refine is a React-based framework for building internal tools, rapidly. JSON:API is a specification for building apis in JSON.

14 lines (13 loc) 371 B
import axios from "axios"; const axiosInstance = axios.create(); axiosInstance.interceptors.response.use((response) => { return response; }, (error) => { const customError = { ...error, message: error.response?.data?.message, statusCode: error.response?.status, }; return Promise.reject(customError); }); export { axiosInstance };