From 4c9c7d9e39990a23e41d4c08d323eba1c241c96a Mon Sep 17 00:00:00 2001 From: Aravindhan Alagesan Date: Fri, 8 Sep 2023 15:57:40 +0530 Subject: [PATCH] Taken the locale from default json file --- resident-ui/src/app/core/services/httpinterceptor.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/resident-ui/src/app/core/services/httpinterceptor.ts b/resident-ui/src/app/core/services/httpinterceptor.ts index 711cd24d..1dc9d097 100644 --- a/resident-ui/src/app/core/services/httpinterceptor.ts +++ b/resident-ui/src/app/core/services/httpinterceptor.ts @@ -52,10 +52,15 @@ export class AuthInterceptor implements HttpInterceptor { next: HttpHandler ): Observable> { request = request.clone({ withCredentials: true }); - request = request.clone({ - // setHeaders: { 'X-XSRF-TOKEN': this.cookieService.get('XSRF-TOKEN') } + if(localStorage.getItem("langCode")){ + request = request.clone({ setHeaders: { 'time-zone-offset': this.localTimeZoneOffset, 'locale': defaultJson['languages'][localStorage.getItem("langCode")]['locale'] } - }); + }); + }else{ + request = request.clone({ + setHeaders: { 'time-zone-offset': this.localTimeZoneOffset, 'locale': defaultJson['languages']["eng"]['locale']} + }); + } return next.handle(request).pipe( tap( event => {