add business_owner
This commit is contained in:
+9
-1
@@ -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))) {
|
||||
|
||||
Reference in New Issue
Block a user