While trying to submit the form with property data, I encountered an error message:
FirebaseError: Expected type 'za', but it was: a custom Ha object
. There doesn't seem to be any information available online explaining what a Ha object is or what type 'za' refers to. I suspect it has something to do with how I am accessing the nested collection, despite attempting different methods without success. Below is my code along with variable data types:
const submitProperty = async () => {
setLoading(true);
const ref = collection(db, "users", user.uid, "properties");
await setDoc(ref, {
propertyName: propertyName, //string
address: address, //string
city: city, //string
zipcode: zipcode, //string
mortgage: mortgage, //number
rentalIncome: rentalIncome, //number
vacancy: vacancy, //bool
propertyTax: propertyTax, //number
});
setLoading(false);
};
I have attempted changing data types and adjusting the way I access the collection and create the document, but unfortunately, the error response remains consistent.