add business_owner
This commit is contained in:
+24
-10
@@ -10,22 +10,28 @@ export const useTenantStore = defineStore('tenant', () => {
|
||||
const loading = ref(false);
|
||||
const isSingleBusiness = ref(false);
|
||||
const singleBusiness = ref<Business | null>(null);
|
||||
/** Business landing opened from multi-tenant discovery (not platform-wide single-business mode). */
|
||||
const focusedBusiness = ref<Business | null>(null);
|
||||
|
||||
const landingBusiness = computed(() =>
|
||||
isSingleBusiness.value ? singleBusiness.value : focusedBusiness.value,
|
||||
);
|
||||
|
||||
const landingBusinessId = computed(() => landingBusiness.value?.id ?? null);
|
||||
|
||||
const brand = computed<SiteBrand>(() => {
|
||||
const base = isSingleBusiness.value ? NIVASH_BRAND : MONTIME_BRAND;
|
||||
|
||||
if (isSingleBusiness.value && singleBusiness.value) {
|
||||
const biz = landingBusiness.value;
|
||||
if (biz) {
|
||||
return {
|
||||
...base,
|
||||
name: singleBusiness.value.title,
|
||||
shortName: singleBusiness.value.title,
|
||||
copyrightName: singleBusiness.value.title,
|
||||
aboutText:
|
||||
singleBusiness.value.description?.trim() || base.aboutText,
|
||||
...NIVASH_BRAND,
|
||||
name: biz.title,
|
||||
shortName: biz.title,
|
||||
copyrightName: biz.title,
|
||||
aboutText: biz.description?.trim() || NIVASH_BRAND.aboutText,
|
||||
};
|
||||
}
|
||||
|
||||
return base;
|
||||
return MONTIME_BRAND;
|
||||
});
|
||||
|
||||
const singleBusinessId = computed(() => singleBusiness.value?.id ?? null);
|
||||
@@ -35,6 +41,10 @@ export const useTenantStore = defineStore('tenant', () => {
|
||||
singleBusiness.value = business;
|
||||
}
|
||||
|
||||
function setFocusedBusiness(business: Business | null) {
|
||||
focusedBusiness.value = business;
|
||||
}
|
||||
|
||||
async function bootstrap() {
|
||||
if (loaded.value || loading.value) return;
|
||||
loading.value = true;
|
||||
@@ -68,8 +78,12 @@ export const useTenantStore = defineStore('tenant', () => {
|
||||
isSingleBusiness,
|
||||
singleBusiness,
|
||||
singleBusinessId,
|
||||
focusedBusiness,
|
||||
landingBusiness,
|
||||
landingBusinessId,
|
||||
brand,
|
||||
bootstrap,
|
||||
syncSingleBusiness,
|
||||
setFocusedBusiness,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user