Skip to content
Snippets Groups Projects
Unverified Commit 71f885b8 authored by Johannes Löthberg's avatar Johannes Löthberg Committed by GitHub
Browse files

Import category notes from YNAB4 exports (#1515)

parent b325bd9b
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@ export namespace YNAB4 {
export interface MasterCategory {
entityType: string;
expanded: boolean;
note?: string;
name: string;
type: string;
deleteable: boolean;
......@@ -31,6 +32,7 @@ export namespace YNAB4 {
export interface SubCategory {
entityType: string;
name: string;
note?: string;
type: string;
// cachedBalance: null;
masterCategoryId: string;
......
......@@ -2,6 +2,7 @@
// into Actual itself. We only want to pull in the methods in that
// case and ignore everything else; otherwise we'd be pulling in the
// entire backend bundle from the API
import { send } from '@actual-app/api/injected';
import * as actual from '@actual-app/api/methods';
import { amountToInteger } from '@actual-app/api/utils';
import AdmZip from 'adm-zip';
......@@ -54,6 +55,9 @@ async function importCategories(
is_income: false,
});
entityIdMap.set(masterCategory.entityId, id);
if (masterCategory.note) {
send('notes-save', { id, note: masterCategory.note });
}
if (masterCategory.subCategories) {
const subCategories = sortByKey(
......@@ -71,6 +75,9 @@ async function importCategories(
group_id: entityIdMap.get(category.masterCategoryId),
});
entityIdMap.set(category.entityId, id);
if (category.note) {
send('notes-save', { id, note: category.note });
}
}
}
}
......
---
category: Enhancements
authors: [kyrias]
---
Import category notes from YNAB4 exports.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment