@innertia-solutions/innertia-nuxt 0.1.76 → 0.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/stores/organization.ts +4 -2
package/package.json
CHANGED
package/stores/organization.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { defineStore } from 'pinia'
|
|
|
12
12
|
* Org shape: { id, key (slug), name }
|
|
13
13
|
*
|
|
14
14
|
* Persistencia:
|
|
15
|
-
* - `currentByContext` en cookie 'innertia_org_by_ctx' (30d, SSR-leíble)
|
|
15
|
+
* - `currentByContext` + `consolidated` en cookie 'innertia_org_by_ctx' (30d, SSR-leíble)
|
|
16
16
|
* - `available` NO se persiste — viene fresco de auth/me en cada boot
|
|
17
17
|
*/
|
|
18
18
|
export const useOrganizationStore = defineStore('organization', {
|
|
@@ -28,7 +28,9 @@ export const useOrganizationStore = defineStore('organization', {
|
|
|
28
28
|
persist: [
|
|
29
29
|
{
|
|
30
30
|
key: 'innertia_org_by_ctx',
|
|
31
|
-
|
|
31
|
+
// `consolidated` también: la vista comunal/consolidada elegida debe sobrevivir a la recarga
|
|
32
|
+
// (el backend igual valida X-Consolidated con los permisos del usuario).
|
|
33
|
+
pick: ['currentByContext', 'consolidated'],
|
|
32
34
|
// pinia-plugin-persistedstate v4: `cookies(...)` es una fábrica que recibe las
|
|
33
35
|
// opciones. Pasarla sin llamar (API v3 + `cookieOptions`) deja un storage inválido
|
|
34
36
|
// y la sede elegida nunca se guarda: cada recarga vuelve al selector de sede.
|