-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathLinkDataset.ts
More file actions
21 lines (18 loc) · 918 Bytes
/
LinkDataset.ts
File metadata and controls
21 lines (18 loc) · 918 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 { IDatasetsRepository } from '../repositories/IDatasetsRepository'
export class LinkDataset implements UseCase<void> {
private datasetsRepository: IDatasetsRepository
constructor(datasetsRepository: IDatasetsRepository) {
this.datasetsRepository = datasetsRepository
}
/**
* Creates a link between a Dataset and a Collection.
*
* @param {number | string} [datasetId] - The dataset id (numeric) or persistent identifier string.
* @param {number | string} [collectionIdOrAlias] - The collection identifier (numeric id) or alias.
* @returns {Promise<void>} - This method does not return anything upon successful completion.
*/
async execute(datasetId: number | string, collectionIdOrAlias: number | string): Promise<void> {
return await this.datasetsRepository.linkDataset(datasetId, collectionIdOrAlias)
}
}