Here is a function that I have:
Join(movementId: string, movement: Movement, userId: string) {
let fetchedUserId: string;
let userList = [];
fetchedUserId = userId;
userList = movement.userList;
userList.push(fetchedUserId);
movement.userList = userList;
console.log('kkk');
console.log(movement);
return this.auth.token.pipe(
take(1),
switchMap(token => {
console.log('kk');
return this.http.put(
`https://gridt-85476.firebaseio.com/movements/${movementId}.json?auth=${token}`,
{ ...movement, userList, id: null }
);
})
);
}
As a novice in Angular, I am working on a small app and this function is a part of it. The purpose of this function is to update a list of users when joining an item in the app. However, I am facing an issue where the function stops working after the pipe, and I am unable to determine the cause. I have checked all the necessary information and it is being received correctly. There are no errors or warnings displayed, and I am at a standstill. You can find the full code here. Any help would be appreciated.