fix: update folder account filtering and set default folder ID for imported accounts

This commit is contained in:
Julien Froidefond
2025-11-27 09:53:00 +01:00
parent e9e44916fd
commit 44cdb6d62a
2 changed files with 5 additions and 2 deletions

View File

@@ -56,7 +56,10 @@ function FolderTreeItem({
}: FolderTreeItemProps) {
const [isExpanded, setIsExpanded] = useState(true)
const folderAccounts = accounts.filter((a) => a.folderId === folder.id)
// Pour le dossier racine, inclure aussi les comptes sans dossier (folderId: null)
const folderAccounts = accounts.filter((a) =>
a.folderId === folder.id || (folder.parentId === null && a.folderId === null)
)
const childFolders = allFolders.filter((f) => f.parentId === folder.id)
const hasChildren = childFolders.length > 0 || folderAccounts.length > 0

View File

@@ -88,7 +88,7 @@ export function OFXImportDialog({ children, onImportComplete }: OFXImportDialogP
bankId: parsed.bankId,
accountNumber: parsed.accountId,
type: parsed.accountType as Account["type"],
folderId: null,
folderId: "folder-root",
balance: parsed.balance,
currency: parsed.currency,
lastImport: new Date().toISOString(),