hey ive been working with a firebase database recently and im trying to add something to the data base with user input but its not working, it keeps throwing me the error: "Function CollectionReference.doc() requires its first argument to be of type non-empty string, but it was: undefined"
here is some of my code
const handleAddChannel = () => {
const channelName = prompt("Enter a new channel name")
if (channelName) {
db.collection('Servers').doc(ServerId).collection('name').add({
channelName: channelName
})
}
}
can anyone help? im trying to add a collection (just calling it name for simplicity)