fix: update folder account filtering and set default folder ID for imported accounts
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user