MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / setCell

Function setCell

packages/app-core/src/lib/database-cells.ts:76–81  ·  view source on GitHub ↗
(doc: DatabaseDoc, rowId: string, fieldId: string, value: string)

Source from the content-addressed store, hash-verified

74// --- row mutations (→ updateDatabaseRows) -------------------------------
75
76export 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
83export function addRow(doc: DatabaseDoc): DatabaseDoc {
84 const id = genId()

Callers 2

moveToFunction · 0.90
commitCellFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected