Currently, I am developing a web application where I can input user information such as name, last name, age, birth date, and a picture. After creating a user, I should be able to delete or edit their details. However, I encountered an issue when updating a user's picture – instead of replacing the existing picture, a new user is being created with the modified image.
You can access the project on StackBlitz using this link: https://stackblitz.com/~/github.com/simeonskiq/Angular-project
edit-user.component.ts :
// Code for the EditUserComponent TypeScript file
// Includes form handling, user updates, and file upload functionality
// Problem: Updating user picture creates a new user instead of modifying existing one
user.service.ts :
// Code for the UserService TypeScript file
// Manages user data, including adding, updating, and deleting users
// Issue: Updating user picture results in creation of new user instead of updating existing one
I have tried various solutions without success. My goal is to successfully update a user's picture without creating a duplicate user.