From 34f14a74e2970b77d4c9185fd9c8f9136dc69e2c Mon Sep 17 00:00:00 2001 From: Yoan FEDELE <yoan.fedele@randstaddigital.com.com> Date: Wed, 16 Apr 2025 11:03:33 +0200 Subject: [PATCH] Changement des routes (path) --- src/app/app.routes.ts | 4 ++-- src/app/shared/services/progress-service.ts | 4 ++-- src/app/views/quiz/quiz-endpage/quiz-endpage.component.ts | 2 +- src/app/views/quiz/quiz-homepage/quiz-homepage.component.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index a0740e3..35d3f1a 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -6,7 +6,7 @@ import { QuizComponent } from './views/quiz/quiz.component'; export const routes: Routes = [ { - path: 'quiz', + path: '', title: "Quiz Inclusif, le jeu", children: [ { path: '', redirectTo: 'accueil', pathMatch: 'full' }, @@ -16,5 +16,5 @@ export const routes: Routes = [ { path: '**', component: QuizComponent }, ], }, - { path: '', redirectTo: 'quiz/accueil', pathMatch: 'full' }, + { path: '', redirectTo: 'accueil', pathMatch: 'full' }, ]; diff --git a/src/app/shared/services/progress-service.ts b/src/app/shared/services/progress-service.ts index 6e4a5d3..5608ecb 100644 --- a/src/app/shared/services/progress-service.ts +++ b/src/app/shared/services/progress-service.ts @@ -39,7 +39,7 @@ export class ProgressService { goToEnd() { /* Envoie sur la page de fin */ this.hasEnded.set(true); - this.router.navigate(["quiz", "fin"], { replaceUrl: true }); + this.router.navigate(["", "fin"], { replaceUrl: true }); } goToNext() { @@ -48,7 +48,7 @@ export class ProgressService { this.dataService.getNewQuestion(); this.questionNumber.update(n => n + 1); this.answered.set(false); - this.router.navigate(["quiz", this.questionNumber().toString()], { + this.router.navigate(["", this.questionNumber().toString()], { queryParams: { theme: this.dataService.currentTopic(), theme_id: this.dataService.currentQuestionId(), repondu: "faux" }, replaceUrl: this.questionNumber() > 0, }); diff --git a/src/app/views/quiz/quiz-endpage/quiz-endpage.component.ts b/src/app/views/quiz/quiz-endpage/quiz-endpage.component.ts index d87ae03..4d84654 100644 --- a/src/app/views/quiz/quiz-endpage/quiz-endpage.component.ts +++ b/src/app/views/quiz/quiz-endpage/quiz-endpage.component.ts @@ -24,6 +24,6 @@ export class QuizEndpageComponent { } GotoQuiz(){ - this.router.navigate(['/quiz/accueil']) + this.router.navigate(['/accueil']) } } diff --git a/src/app/views/quiz/quiz-homepage/quiz-homepage.component.ts b/src/app/views/quiz/quiz-homepage/quiz-homepage.component.ts index 8657bc4..38dfa06 100644 --- a/src/app/views/quiz/quiz-homepage/quiz-homepage.component.ts +++ b/src/app/views/quiz/quiz-homepage/quiz-homepage.component.ts @@ -23,7 +23,7 @@ export class QuizHomepageComponent { constructor(private router:Router) {} commencer(){ - this.router.navigate(['/quiz/temps']) + this.router.navigate(['/temps']) } - + } -- GitLab