move the correlation id to the ngrx store

This commit is contained in:
Art Lowel
2021-12-16 14:17:28 +01:00
committed by Yura Bondarenko
parent ba268d4f28
commit 2fe5587e02
8 changed files with 125 additions and 35 deletions

View File

@@ -156,21 +156,6 @@ const PROVIDERS = [
useClass: LogInterceptor,
multi: true
},
// insert the unique id of the user that is using the application utilizing cookies
{
provide: APP_INITIALIZER,
useFactory: (cookieService: CookieService, uuidService: UUIDService) => {
const correlationId = cookieService.get('CORRELATION-ID');
// Check if cookie exists, if don't, set it with unique id
if (!correlationId) {
cookieService.set('CORRELATION-ID', uuidService.generate());
}
return () => true;
},
multi: true,
deps: [CookieService, UUIDService]
},
{
provide: DYNAMIC_ERROR_MESSAGES_MATCHER,
useValue: ValidateEmailErrorStateMatcher