Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
5557baa643
commit
bde7c5ef3c
@@ -63,6 +63,8 @@ export function SortableLedgerRow({ entry, onPatch, onRemove }: Props) {
|
||||
const commit = (key: keyof EditableEntry, raw: string | number) => {
|
||||
let val: any = raw;
|
||||
if (NUM_COLS.some((c) => c.key === key)) val = raw === "" ? 0 : Number(raw) || 0;
|
||||
// Allow blank dates / blank text fields
|
||||
if (key === "entry_date" && raw === "") val = null;
|
||||
if (val === (entry as any)[key]) return;
|
||||
setDraft((d) => ({ ...d, [key]: val }));
|
||||
onPatch(entry.id, { [key]: val } as any);
|
||||
|
||||
Reference in New Issue
Block a user