Fetch hierarchy structure of all collections of a user
mohhsen67 opened this issue · comments
Mohsen Jafari commented
I have used the following url to fetch user collections (by sending user api token):
${dataverse_url}/api/search?q=*&type=dataverse&sort=date&order=desc
And it returned the following structure:
{
q: '*',
total_count: 7,
start: 0,
spelling_alternatives: {},
items: [
{
name: 'some_name';
type: 'dataverse',
url: 'some_url',
identifier: '59a7d6f8-ce52-417e-a5c0-dfd7695e41fd',
description: '',
published_at: '2024-04-22T13:35:33Z'
},
{
name: 'some_name';
type: 'dataverse',
url: 'some_url',
identifier: '70f86a0d-7763-40e0-b14a-f207e0d1ea98',
description: '',
published_at: '2024-04-22T13:21:55Z'
},
{
name: 'some_name';
type: 'dataverse',
url: 'some_url',
identifier: '53b4e2eb-c404-4156-aca9-abb5276378a7',
description: '',
published_at: '2024-04-22T11:52:59Z'
},
{
name: 'some_name';
type: 'dataverse',
url: 'some_url',
identifier: '9679bdfe-7d6f-48dc-af73-4c1c95e149ce',
description: '',
published_at: '2024-04-22T11:42:46Z'
},
{
name: 'some_name';
type: 'dataverse',
url: 'some_url',
identifier: 'b05db8c1-53dd-46dc-96e4-d08672178749',
description: '',
published_at: '2024-04-22T11:42:10Z'
},
{
name: 'some_name';
type: 'dataverse',
url: 'some_url',
identifier: 'pantabio',
published_at: '2024-04-19T15:01:32Z'
},
{
name: 'some_name';
type: 'dataverse',
url: 'some_url',
identifier: 'my-dataverse',
published_at: '2024-04-17T07:06:41Z'
}
],
count_in_response: 7
}
My intention is to show all collections that the user has access to (and can create a nested collection in them). I also need to show this data in a hierarchy tree so that it is clear to the user that what collection is child of what collection and so on.
Related discussions: