I am using NgRx Data on an Angular 9 project and I am trying to save an user using the add() method. The downside is that the api endpoint is something like
http://localhost:{{port}}/something/{{clientId}}/users
UserComponent
saveUser(user) {
this.userService.add(user);
}
UserService
export class UserService extends EntityCollectionServiceBase<User> {
constructor(serviceElementsFactory: EntityCollectionServiceElementsFactory) {
super('User', serviceElementsFactory);
}
}
Is there a method to solve this issue? I don`t want to modify the back-end endpoint.
Solved.
Registered a new data service that extends DefaultDataService
src/app/store/entity-store-module.ts
src/app/store/test-data.service.ts