In my latest project using Angular-Firestore, I am facing an issue with getting data from the HTML page and inserting it into a list of data using *ngFor. Every time I press the submit button on the form, some user input data is required while other data comes from the *ngFor loop. Unfortunately, I keep encountering the following error message: SellinglistComponent.html:53 ERROR Error: Function DocumentReference.set() called with invalid data. Unsupported field value: undefined (found in field ownerID)
Interestingly, when I click the submit button twice, the process works smoothly without any errors, and I can see the data being sent to the database. Can anyone help me understand why this may be happening? Any guidance on how to solve this issue would be greatly appreciated. Thank you.
Here is the TypeScript file: