Play around with data storage, still not working

This commit is contained in:
Ray 2023-12-28 02:26:27 +00:00 committed by GitHub
parent 75572930f8
commit e6b8047001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -50,13 +50,13 @@ export function MyForm(props) {
// Create a function to handle the form submission and add data to Firebase. // Create a function to handle the form submission and add data to Firebase.
const submitHandler = async (event) => { const submitHandler = async (event) => {
event.preventDefault() event.preventDefault()
const incident = { submitter, date, context, selectedOptions } const incidents = { setSubmitter, setDate, setContext, setSelectedOptions }
const col = collection(db, `incidents/`) const col = collection(db, `incidents/${props.incidentId}/incident_logs`)
const ref = await addDoc(col, incident) const ref = await addDoc(col, incidents)
console.log(ref) console.log(ref)
} }
// Create form for user to imput data // Create form for user to imput data
return ( return (