cell updates firestore directly used for non-text based fields

This commit is contained in:
shams mosowi
2019-09-16 12:03:21 +10:00
parent 61dfe3915f
commit 08435a965e
2 changed files with 5 additions and 2 deletions

View File

@@ -42,7 +42,11 @@ const useCell = (intialOverrides: any) => {
cellDispatch({ updatedValue: value });
};
const actions = { set, update };
const updateFirestore = (cell: Cell) => {
cellDispatch({ cell: null });
cellState.updateCell(cell);
};
const actions = { set, update, updateFirestore };
return [cellState, actions];
};

View File

@@ -140,7 +140,6 @@ const useTable = (intialOverrides: any) => {
// TODO: update row locally
// tableState.rows[cell.rowIndex][cell.fieldName] = cell.value;
// tableDispatch({ rows: tableState.rows });
// update document
db.collection(tableState.path)
.doc(cell.docId)