Files
nova-tenancy/resources/js/tool.js
T
2026-09-09 16:33:18 +03:30

26 lines
656 B
JavaScript

import NovaTenancy from './pages/NovaTenancy.vue'
import TenantAppLogo from './components/TenantAppLogo.vue'
Nova.inertia('NovaTenancy', NovaTenancy)
Nova.booting(app => {
if (Nova.config('novaTenancy')?.branding?.enabled !== false) {
app.component('AppLogo', TenantAppLogo)
}
})
Nova.request().interceptors.response.use(
response => response,
error => {
if (
error.response?.status === 409 &&
error.response?.data?.code === 'tenant_selection_required'
) {
const selectorPath = Nova.config('novaTenancy')?.selectorPath || '/nova-tenancy'
Nova.visit(selectorPath)
}
return Promise.reject(error)
}
)