writing to each box

This commit is contained in:
Harmony
2019-11-15 14:27:56 -05:00
parent f5c8edd74c
commit 3b9ee304db
2 changed files with 11 additions and 3 deletions

View File

@@ -7,8 +7,16 @@ export default function NewItem({ addItem, boxId }) {
const handleSubmit = e => {
e.preventDefault();
let retroRef = databaseRef.ref('retros/1/questions');
let retroRef;
if(boxId === "1"){
retroRef = databaseRef.ref('retros/1/www');
} else if(boxId === "2"){
retroRef = databaseRef.ref('retros/1/!www');
} else if(boxId === "3"){
retroRef = databaseRef.ref('retros/1/questions');
} else {
retroRef = databaseRef.ref('retros/1/a');
}
const item = {
completed: false,
id: uuid.v4(),

View File

@@ -46,5 +46,5 @@ export default function FirebaseWrapper({boxId}) {
if(!cards) {
return <div>loading...</div>;
};
return <Cards item={cards} setItem={()=> {}}/>
return <Cards item={cards} boxId={boxId} setItem={()=> {}}/>
}