Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getAccount() {
- this.accounts.getAccount(this.accountId).subscribe(
- response => {
- this.accountView = this.apiHandler.responseHandler(response);
- this.accountCompare = this.apiHandler.responseHandler(response);
- console.log(this.accountCompare);
- },
- (err) => {
- this.apiHandler.errorHandler(err);
- }
- );
- }
- //then in this function, I filter accountView, however it appears to also be affecting accountCompare as well.
- userDelete(id) {
- if (this.accountCompare.users.some(item => item.id === id)) {
- this.accountForm.value.usersToDelete.push(id);
- }
- this.accountView.users = this.accountView.users.filter(user => user.id !== id);
- /* this.accountForm.value.usersToAdd = this.accountForm.value.usersToAdd.filter(user => id !== id); */
- console.log(this.accountCompare);
- }
Add Comment
Please, Sign In to add comment