Files
server/core/src/stores/tenantStore.ts
2026-02-10 18:46:11 -05:00

28 lines
575 B
TypeScript

import { defineStore } from 'pinia';
export interface TenantState {
id: string | null;
domain: string | null;
label: string | null;
}
export const useTenantStore = defineStore('tenantStore', {
state: () => ({
tenant: null as TenantState | null,
}),
actions: {
init(tenant: Partial<TenantState> | null) {
this.tenant = tenant
? {
id: tenant.id ?? null,
domain: tenant.domain ?? null,
label: tenant.label ?? null,
}
: null;
},
reset() {
this.tenant = null;
},
},
});