4

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)
    )
  }
lethalSid
  • 51
  • 3
  • 1
    It's all documented at https://ngrx.io/guide/data/entity-dataservice#custom-entitydataservice –  Jun 04 '20 at 00:00
  • yes it is but I'm wondering if i can manually override the crud methods in the DefaultDataService. I haven't found an example of that yet – lethalSid Jun 04 '20 at 11:40
  • I am having an issue trying to override the getByKey(key: any) method...it still uses the default implementation. Overriding getAll() works properly, but getByKey does not. Any ideas as to why? – MattE Jan 29 '21 at 15:10

0 Answers0