edit business owner

This commit is contained in:
2026-06-13 10:19:31 +03:30
parent 5eec309b54
commit d1a471199b
17 changed files with 1268 additions and 220 deletions
+9
View File
@@ -1,6 +1,7 @@
import { createRouter, createWebHistory } from 'vue-router';
import { useAuthStore } from '@/stores/auth';
import { useProfileModalStore } from '@/stores/profile-modal';
import { useOwnedBusiness } from '@/composables/useOwnedBusiness';
import { loginRouteWithRedirect } from '@/utils/auth-redirect';
const router = createRouter({
@@ -79,6 +80,14 @@ router.beforeEach(async (to) => {
return auth.isBusinessOwner ? { name: 'app-owner' } : { name: 'app-home' };
}
if (to.name === 'app-business-detail' && auth.isBusinessOwner) {
const { ensureLoaded, isOwnBusiness } = useOwnedBusiness();
await ensureLoaded();
if (isOwnBusiness(String(to.params.id))) {
return { name: 'app-owner' };
}
}
if (to.meta.guest && auth.isLoggedIn) {
return { name: 'app-home' };
}