@adv-ui/ij-axios-interceptor
v1.4.0
Published
Axios interceptor
Downloads
34
Maintainers
Keywords
Readme
Jobs Axios interceptors
Description
This is a package where some general axios interceptors can be setted to use in different projects.
Features
Intercept request regarding the tenant
The setBlockingInterceptor
method purpose is to block requests depending on the tenant we provide
import AxiosInterceptor from '@adv-ui/ij-axios-interceptor'
import {FetcherFactory} from '@s-ui/domain'
const fetcher = FetcherFactory.httpFetcher({
config: {}
})
const filterTenantPaths = [
{
tenant: 'infojobs',
whiteListPaths: [{path: '/users', method: 'GET'}, {path: '/user/:id'}]
}
]
const axiosInterceptor = new AxiosInterceptor()
axiosInterceptor.setBlockingInterceptor({
fetcher,
currentTenant: 'infojobs',
filterTenantPaths
})
Release a new version
Once you have merged your changes, the @s-ui/ci tool will automatically release a new minor version for the dependency @s-ui/ij-axios-interceptor