diff --git a/packages/loot-core/src/server/api-models.ts b/packages/loot-core/src/server/api-models.ts index 04bdc76f417..4f82605ef5f 100644 --- a/packages/loot-core/src/server/api-models.ts +++ b/packages/loot-core/src/server/api-models.ts @@ -32,6 +32,7 @@ export const categoryModel = { id: category.id, name: category.name, is_income: category.is_income ? true : false, + is_hidden: category.is_hidden ? true : false, group_id: category.cat_group, }; }, @@ -41,6 +42,9 @@ export const categoryModel = { if ('is_income' in category) { result.is_income = category.is_income ? 1 : 0; } + if ('is_hidden' in category) { + result.hidden = category.is_hidden ? 1 : 0; + } if ('group_id' in category) { result.cat_group = category.group_id; } @@ -56,6 +60,7 @@ export const categoryGroupModel = { id: group.id, name: group.name, is_income: group.is_income ? true : false, + is_hidden: group.is_hidden ? true : false, categories: group.categories.map(categoryModel.toExternal), }; }, @@ -65,6 +70,9 @@ export const categoryGroupModel = { if ('is_income' in group) { result.is_income = group.is_income ? 1 : 0; } + if ('is_hidden' in group) { + result.hidden = group.is_hidden ? 1 : 0; + } if ('categories' in group) { result.categories = group.categories.map(categoryModel.fromExternal); }