forked from IQSS/dataverse-client-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetDatasetLinkedCollections.ts
More file actions
21 lines (18 loc) · 917 Bytes
/
Copy pathGetDatasetLinkedCollections.ts
File metadata and controls
21 lines (18 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { DatasetLinkedCollection } from '../models/DatasetLinkedCollection'
import { IDatasetsRepository } from '../repositories/IDatasetsRepository'
export class GetDatasetLinkedCollections implements UseCase<DatasetLinkedCollection[]> {
private datasetsRepository: IDatasetsRepository
constructor(datasetsRepository: IDatasetsRepository) {
this.datasetsRepository = datasetsRepository
}
/**
* Returns a list of collections linked to a dataset.
*
* @param {number | string} [datasetId] - The dataset identifier, which can be a string (for persistent identifiers), or a number (for numeric identifiers).
* @returns {Promise<DatasetLinkedCollection[]>}
*/
async execute(datasetId: number | string): Promise<DatasetLinkedCollection[]> {
return await this.datasetsRepository.getDatasetLinkedCollections(datasetId)
}
}