mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 20:44:32 -05:00
* Fix issue #3252 remove extra space from category name * add md file * rename
This commit is contained in:
@@ -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' } };
|
||||
|
||||
6
upcoming-release-notes/3495.md
Normal file
6
upcoming-release-notes/3495.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [junyuanz1]
|
||||
---
|
||||
|
||||
Removes whitespace from both ends of the category name
|
||||
Reference in New Issue
Block a user