mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 10:14:53 -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({
|
return db.insertCategory({
|
||||||
name,
|
name: name.trim(),
|
||||||
cat_group: groupId,
|
cat_group: groupId,
|
||||||
is_income: isIncome ? 1 : 0,
|
is_income: isIncome ? 1 : 0,
|
||||||
hidden: hidden ? 1 : 0,
|
hidden: hidden ? 1 : 0,
|
||||||
@@ -291,7 +291,10 @@ handlers['category-create'] = mutator(async function ({
|
|||||||
handlers['category-update'] = mutator(async function (category) {
|
handlers['category-update'] = mutator(async function (category) {
|
||||||
return withUndo(async () => {
|
return withUndo(async () => {
|
||||||
try {
|
try {
|
||||||
await db.updateCategory(category);
|
await db.updateCategory({
|
||||||
|
...category,
|
||||||
|
name: category.name.trim(),
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.message.toLowerCase().includes('unique constraint')) {
|
if (e.message.toLowerCase().includes('unique constraint')) {
|
||||||
return { error: { type: 'category-exists' } };
|
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