Skip to content

Build your personal knowledge base with Trilium Notes

fix(react/promoted_attributes): unable to read trim at server level

Elian Doran08ade8371cc0
diff --git a/apps/client/src/widgets/PromotedAttributes.tsx b/apps/client/src/widgets/PromotedAttributes.tsx
index ad501e35d6..b7ffca0602 100644
--- a/apps/client/src/widgets/PromotedAttributes.tsx
+++ b/apps/client/src/widgets/PromotedAttributes.tsx
@@ -436,14 +436,14 @@ function buildPromotedAttributeLabelChangedListener({ note, cell, componentId, .
return debounce(onChange, 250);
}
-function updateAttribute(note: FNote, cell: Cell, componentId: string, value: string) {
+function updateAttribute(note: FNote, cell: Cell, componentId: string, value: string | undefined) {
return server.put<UpdateAttributeResponse>(
`notes/${note.noteId}/attribute`,
{
attributeId: cell.valueAttr.attributeId,
type: cell.valueAttr.type,
name: cell.valueName,
- value: value
+ value: value || ""
},
componentId
);