0

My goal is to send to the backend a request like this "localhost:8889/api/notebooks/1". By default it sends this request "localhost:8889/api/notebook/1".

What I tried until now is to provide a custom HttpGenerator in app.module.ts.

    {
      provide: HttpUrlGenerator,
      useClass: class extends DefaultHttpUrlGenerator
      {
        override entityResource(entityName: string, root: string, trailingSlashEndpoints: boolean): string {
          return super.collectionResource(entityName, root);
        }
      }
    },

But it gives me this error Error: Module not found: Error: Package path ./src/dataservices/http-url-generator is not exported from package *****\node_modules\@ngrx\data (see exports field in *****\node_modules\@ngrx\data\package.json)

What am I doing wrong?

1 Answers1

0

I followed the instructions from the documentation below.

https://ngrx.io/guide/data/extension-points .

Important You need to restart the project for it to work. Otherwise you'll encounter errors like Module not found