How do I override/replace the DefaultDataService in NgRx and write custom API methods

Viewed 390

Hi I'm having trouble using a custom API call with NgRx Data. I am trying to use my own custom call in the EntityService but it isn't working

Instead of this:

getAll(): Observable<T[]> {
    return this.execute('GET', this.entitiesUrl);
  }

I need something that NgRx Data can use like this:

 getAllTournaments(params?: any): Observable<Tournaments[]> {
    return this.http.post(`${API}/.../...`, params).pipe(
      map(result => result)
    )
  }
0 Answers
Related