Ajuste em Massa - Paciente, Terapeuta, Clinica e Admin - Inicio agenda

This commit is contained in:
Leonardo
2026-02-22 17:56:01 -03:00
parent 6eff67bf22
commit 89b4ecaba1
77 changed files with 9433 additions and 1995 deletions
+24 -9
View File
@@ -6,20 +6,35 @@ import { useEntitlementsStore } from '@/stores/entitlementsStore'
const route = useRoute()
const tenant = useTenantStore()
const ent = useEntitlementsStore()
const tenantStore = useTenantStore()
const entStore = useEntitlementsStore()
onMounted(async () => {
await tenant.loadSessionAndTenant()
await ent.loadForTenant(tenant.activeTenantId)
// 1) carrega sessão + tenant ativo (do seu fluxo atual)
await tenantStore.loadSessionAndTenant()
// pode remover esses logs depois
console.log('tenant.activeTenantId', tenant.activeTenantId)
console.log('role', tenant.activeRole)
console.log('can online_scheduling.manage?', ent.can('online_scheduling.manage'))
// 2) carrega permissões do tenant ativo (se existir)
if (tenantStore.activeTenantId) {
await entStore.loadForTenant(tenantStore.activeTenantId)
}
// 3) debug: localStorage com rótulos
console.groupCollapsed('[Debug] Tenant localStorage')
console.log('tenant_id:', localStorage.getItem('tenant_id'))
console.log('currentTenantId:', localStorage.getItem('currentTenantId'))
console.log('tenant:', localStorage.getItem('tenant'))
console.groupEnd()
// 4) debug: stores
console.groupCollapsed('[Debug] Tenant stores')
console.log('route:', route.fullPath)
console.log('activeTenantId:', tenantStore.activeTenantId)
console.log('activeRole:', tenantStore.activeRole)
console.log("can('online_scheduling.manage'):", entStore.can('online_scheduling.manage'))
console.groupEnd()
})
</script>
<template>
<router-view />
</template>
</template>