I am trying to register a user and make them fill a form and save that data into a userSchema and if the user is already registered then show they are registered but i am getting the following error when i log
for (const [key, value] of Object.entries(collectedInteractions.fields)) {
submittedData[key] = value.value;
}
collectedInteractions.fields is accessing fields of ModalSubmitInteraction
Transforming with Object.entries yields [["components", ActionRowModalData[]],["fields", Collection<string, ModalActionRowComponent>]]
Now you attempt to access value of the values which don’t have it. Thus undefined.
So now my data is being saved into database but the form on discord is not submiting it shows something went wrong but the form doesnt close but still i get the scuess message on my discord channel