research-software-directory / RSD-as-a-service

This repo contains the new RSD-as-a-service implementation
https://research.software
27 stars 14 forks source link

Remove `null` possibility from `TreeNode<T>` #1242

Closed ewan-escience closed 4 months ago

ewan-escience commented 4 months ago

The TreeNode<T> type in frontend/types/TreeNode.ts allows for its content to be null. We should remove that possibility for much more convenience. In order to do so, we should adapt the function categoryEntriesToRoots in frontend/components/category/apiCategories.ts to delay creating parent nodes by temporarily saving the children of a yet to be created parent in a Map.