Play around with data storage, still not working
This commit is contained in:
parent
75572930f8
commit
e6b8047001
14
src/App.js
14
src/App.js
|
@ -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 (
|
||||||
|
|
Loading…
Reference in New Issue