add business_owner

This commit is contained in:
2026-07-15 19:14:52 +03:30
parent c02ff06e2c
commit 0d4158db4e
12 changed files with 267 additions and 108 deletions
+9 -1
View File
@@ -30,6 +30,11 @@ const router = createRouter({
name: 'app-business-detail',
component: () => import('@/views/app/AppBusinessDetailView.vue'),
},
{
path: '/app/businesses/:id/book',
name: 'app-business-book',
component: () => import('@/views/app/AppBusinessBookingView.vue'),
},
{
path: '/app/bookings',
name: 'app-bookings',
@@ -86,7 +91,10 @@ router.beforeEach(async (to) => {
return auth.isBusinessOwner ? { name: 'app-owner' } : { name: 'app-home' };
}
if (to.name === 'app-business-detail' && auth.isBusinessOwner) {
if (
(to.name === 'app-business-detail' || to.name === 'app-business-book') &&
auth.isBusinessOwner
) {
const { ensureLoaded, isOwnBusiness } = useOwnedBusiness();
await ensureLoaded();
if (isOwnBusiness(String(to.params.id))) {