From 01118e5d4ea81ad59f9aab960cf178e80433dbd1 Mon Sep 17 00:00:00 2001 From: Vincent BENOIT Date: Sun, 23 Oct 2022 19:07:48 +0200 Subject: [PATCH] correction bug sur reception 401 depuis la page horaires --- src/app/components/home/workspace/hours/hours.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/components/home/workspace/hours/hours.component.ts b/src/app/components/home/workspace/hours/hours.component.ts index 30bffc0..f77545a 100644 --- a/src/app/components/home/workspace/hours/hours.component.ts +++ b/src/app/components/home/workspace/hours/hours.component.ts @@ -30,7 +30,11 @@ export class HoursComponent implements OnInit { this.schedRows = Object.keys(datas[0].horaires).length; this.isProcessing = false; }, err => { - this.toast.error("Erreur de récupération des horaires"); + if(err.status == 401) { + this.router.navigateByUrl("/login"); + } else { + this.toast.error("Erreur de récupération des horaires"); + } this.isProcessing = false; } );