Created
December 30, 2021 09:50
-
-
Save Vitaleks-project/7a8905c84b64dc74b74c967ab8aaa461 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Build folders tree. | |
// Example how should result looks like | |
// folderTree = { | |
// folders: [{ | |
// folders: [{ | |
// id, | |
// name, | |
// folders: [] | |
// }] | |
// }] | |
// }; | |
const folders = [ | |
{ id: 1, parent: null, name: 'Main videos' }, | |
{ id: 2, parent: 1, name: 'Kitchen videos' }, | |
{ id: 3, parent: 1, name: 'Garden videos' }, | |
{ id: 4, parent: 3, name: 'Garden videos1' }, | |
{ id: 5, parent: 3, name: 'Garden videos2' }, | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment