Skip to content

Commit

Permalink
preparation for upgrading rest-api to prevent admin box frameworks te…
Browse files Browse the repository at this point in the history
…sting failures
  • Loading branch information
doregg committed Oct 12, 2023
1 parent 131c45e commit bc8cc03
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Subscription, PartialObserver, BehaviorSubject } from 'rxjs';
import { User, AuthState } from '@frontegg/redux-store';
import { Injectable } from '@angular/core';
import { Entitlement, LoadEntitlementsCallback, EntitledToOptions } from '@frontegg/types';
import { UserEntitlementsResponse } from '@frontegg/rest-api';

import {
FronteggState,
Expand All @@ -21,7 +22,7 @@ import { FronteggAppService } from './frontegg-app.service';
providedIn: 'root',
})
export class FronteggEntitlementsService {
private entitlementsStateSubject = new BehaviorSubject<User['entitlements']>(undefined);
private entitlementsStateSubject = new BehaviorSubject<any>(undefined);

constructor(private fronteggAppService: FronteggAppService) {
const state = this.fronteggAppService.fronteggApp.store.getState() as FronteggState;
Expand All @@ -40,7 +41,7 @@ export class FronteggEntitlementsService {
* @param authState
*/
private updateEntitlementsStateIfNeeded(authState: AuthState): void {
const entitlementsState = authState.user?.entitlements;
const entitlementsState = authState.user?.entitlements as any;
if (this.entitlementsStateSubject.value === entitlementsState) {
return;
}
Expand All @@ -56,7 +57,7 @@ export class FronteggEntitlementsService {
* @returns a subscription to be able to unsubscribe
*/
private getEntitlementsManipulatorSubscription<Result>(
dataManipulator: (entitlements: User['entitlements']) => Result,
dataManipulator: (entitlements: any) => Result,
observer: PartialObserver<Result>
): Subscription {
// used for computing the entitlements result because we don't return the state itself, but a calculated one
Expand Down

0 comments on commit bc8cc03

Please sign in to comment.