From 9beffc0c5bf65946c9c13dedd179f18d3bbf5a0d Mon Sep 17 00:00:00 2001 From: Junyuan Zheng <53073448+junyuanz1@users.noreply.github.com> Date: Mon, 23 Sep 2024 23:07:23 -0700 Subject: [PATCH 1/3] Fix issue #3252 remove extra space from category name --- packages/loot-core/src/server/main.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/loot-core/src/server/main.ts b/packages/loot-core/src/server/main.ts index d24ca17befe..9abfd5cd964 100644 --- a/packages/loot-core/src/server/main.ts +++ b/packages/loot-core/src/server/main.ts @@ -280,7 +280,7 @@ handlers['category-create'] = mutator(async function ({ } return db.insertCategory({ - name, + name: name.trim(), cat_group: groupId, is_income: isIncome ? 1 : 0, hidden: hidden ? 1 : 0, @@ -291,7 +291,10 @@ handlers['category-create'] = mutator(async function ({ handlers['category-update'] = mutator(async function (category) { return withUndo(async () => { try { - await db.updateCategory(category); + await db.updateCategory({ + ...category, + name: category.name.trim(), + }); } catch (e) { if (e.message.toLowerCase().includes('unique constraint')) { return { error: { type: 'category-exists' } }; From 09fe6a9d12c3b64c85b7dbdb3588ec496c667581 Mon Sep 17 00:00:00 2001 From: Junyuan Zheng <53073448+junyuanz1@users.noreply.github.com> Date: Mon, 23 Sep 2024 23:12:15 -0700 Subject: [PATCH 2/3] add md file --- upcoming-release-notes/3252.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 upcoming-release-notes/3252.md diff --git a/upcoming-release-notes/3252.md b/upcoming-release-notes/3252.md new file mode 100644 index 00000000000..b4ddc5cd82d --- /dev/null +++ b/upcoming-release-notes/3252.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [junyuanz1] +--- + +Removes whitespace from both ends of the category name From 54daaf3a1e0ff34f63864a65945fc2b70790f0f4 Mon Sep 17 00:00:00 2001 From: Junyuan Zheng <53073448+junyuanz1@users.noreply.github.com> Date: Mon, 23 Sep 2024 23:13:49 -0700 Subject: [PATCH 3/3] rename --- upcoming-release-notes/{3252.md => 3495.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename upcoming-release-notes/{3252.md => 3495.md} (100%) diff --git a/upcoming-release-notes/3252.md b/upcoming-release-notes/3495.md similarity index 100% rename from upcoming-release-notes/3252.md rename to upcoming-release-notes/3495.md