1

I want to change NgRx data additionalCollectionState property count when I request to getWithQuery. Unfortunately there is no change.

EntityMetaData

Dev Tools

@Injectable()
export class CourseLevelDataService extends DefaultDataService<any> {
  constructor(
    http: HttpClient,
    httpUrlGenerator: HttpUrlGenerator,
    private store: Store<EntityCache>,
    private dispatcher: Store<EntityCacheDispatcher>
  ) {
    super('CourseLevel', http, httpUrlGenerator);
    const token = localStorage.getItem('auth');
  }
  
  getWithQuery(params: QueryParams): Observable<any> {
    var count;
    return this.http
      .get<any>(environment.apiUrl + `CourseLevel`, { params })
      .pipe(
        tap((res) => {
          count = res.count;
          //I Want to change here count
          this.store.dispatch(addCount({ count: count }));
          console.log(count);
        }),
        map((res) => res['data'])
      );
  }
}
metodribic
  • 1,561
  • 17
  • 27
Murad Agha
  • 11
  • 2
  • Hi Murad and welcome to StackOverflow. Please read [Why not upload images of code error when asking a question?](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question) and edit your question so your problem will gain more traction and consequently you can get answer faster – metodribic Oct 12 '21 at 06:49
  • Did you resolve this? – Ania Feb 15 '22 at 15:39

0 Answers0