From d2696b16accde323def902e7f35c8d83eb451656 Mon Sep 17 00:00:00 2001 From: Vincent Guillet Date: Tue, 14 Oct 2025 14:53:28 +0200 Subject: [PATCH] update routing to include AddProduct component and adjust guard activations --- client/src/app/app.routes.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/app/app.routes.ts b/client/src/app/app.routes.ts index 800cfb2..fb99875 100644 --- a/client/src/app/app.routes.ts +++ b/client/src/app/app.routes.ts @@ -4,9 +4,10 @@ import {RegisterComponent} from './pages/register/register.component'; import {LoginComponent} from './pages/login/login.component'; import {ProfileComponent} from './pages/profile/profile.component'; import {guestOnlyCanActivate, guestOnlyCanMatch} from './guards/guest-only/guest-only.guard'; -import {authOnlyCanMatch} from './guards/auth-only/auth-only.guard'; +import {authOnlyCanActivate, authOnlyCanMatch} from './guards/auth-only/auth-only.guard'; import {AdminComponent} from './pages/admin/admin.component'; -import {adminOnlyCanMatch} from './guards/admin-only/admin-only.guard'; +import {adminOnlyCanActivate, adminOnlyCanMatch} from './guards/admin-only/admin-only.guard'; +import {AddProductComponent} from './pages/add-product/add-product.component'; export const routes: Routes = [ { @@ -45,7 +46,13 @@ export const routes: Routes = [ path : 'admin', component: AdminComponent, canMatch: [adminOnlyCanMatch], - canActivate: [adminOnlyCanMatch] + canActivate: [adminOnlyCanActivate] + }, + { + path : 'add-product', + component: AddProductComponent, + canMatch: [authOnlyCanMatch], + canActivate: [authOnlyCanActivate] }, { path : '**',