(doc: DatabaseDoc, rowId: string, fieldId: string, value: string)
| 74 | // --- row mutations (→ updateDatabaseRows) ------------------------------- |
| 75 | |
| 76 | export function setCell(doc: DatabaseDoc, rowId: string, fieldId: string, value: string): DatabaseDoc { |
| 77 | return { |
| 78 | ...doc, |
| 79 | rows: doc.rows.map((r) => (r.id === rowId ? { ...r, cells: { ...r.cells, [fieldId]: value } } : r)) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | export function addRow(doc: DatabaseDoc): DatabaseDoc { |
| 84 | const id = genId() |
no outgoing calls
no test coverage detected