IQSS / dataverse-client-javascript

A Dataverse client for JavaScript and TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create GetCollection use case

GPortas opened this issue · comments

Overview of the Feature Request

We need to implement a use case in the package for retrieving a collection. This use case will be utilized on the Collection page of the SPA.

Currently, for the SPA, we require the following properties to be added to the new collection model: name, affiliation, description, and owner information. Additionally, we need to map any other properties present in the API response payload that might be useful for any package consumer.

We can rely on the GetDataset use case as an example for the development of the new use case.

The API endpoint associated to the new use case is the /api/dataverses/{id} endpoint: https://github.com/IQSS/dataverse/blob/develop/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java#L613

In case we find missing properties in the payload, we need to create an API extension issue.

What kind of user is the feature intended for?

SPA user

What inspired the request?

  • Frontend meeting for devs and SPA needs

@GPortas In your opinion, where should the useCase for Collections be in the file structure? I see src/datasets as a likely location but also unsure whether we are separating them out into something like src/collections ? @MellyGray also looking for your advice as always :)

Edit: Looks like in the useCases file we have specified the NewDatasetDTO in /src/datasets/domain/dtos/NewDatasetDTO.ts so I will go off of that unless otherwise specified.

@M27Mangan, I would recommend placing it under /src/collections because a collection is not a dataset but rather an entity in itself. So, it makes sense to separate it into its distinct directory

PR #134 opened for review