Quote from
etichenor on October 10, 2018, 3:51 pm
Here's how I resolved it. I removed the second OperatorFunction:
updateRole(role: Role) {
if (role.id) {
return this.accountEndpoint.getUpdateRoleEndpoint(role, role.id).pipe(
tap(data => this.onRolesChanged([role], AccountService.roleModifiedOperation)));
}
else {
return this.accountEndpoint.getRoleByRoleNameEndpoint<Role>(role.name).pipe<Role>(
mergeMap(foundRole => {
role.id = foundRole.id;
return this.accountEndpoint.getUpdateRoleEndpoint(role, role.id)
}));
//,
//tap(data => this.onRolesChanged([role], AccountService.roleModifiedOperation)));
}
}
Here's how I resolved it. I removed the second OperatorFunction:
updateRole(role: Role) {
if (role.id) {
return this.accountEndpoint.getUpdateRoleEndpoint(role, role.id).pipe(
tap(data => this.onRolesChanged([role], AccountService.roleModifiedOperation)));
}
else {
return this.accountEndpoint.getRoleByRoleNameEndpoint<Role>(role.name).pipe<Role>(
mergeMap(foundRole => {
role.id = foundRole.id;
return this.accountEndpoint.getUpdateRoleEndpoint(role, role.id)
}));
//,
//tap(data => this.onRolesChanged([role], AccountService.roleModifiedOperation)));
}
}
Ingo has reacted to this post.