forked from uncch-rdmc/dataverse-client-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetDatasetLocks.ts
More file actions
21 lines (18 loc) · 822 Bytes
/
GetDatasetLocks.ts
File metadata and controls
21 lines (18 loc) · 822 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'
import { DatasetLock } from '../models/DatasetLock'
export class GetDatasetLocks implements UseCase<DatasetLock[]> {
private datasetsRepository: IDatasetsRepository
constructor(datasetsRepository: IDatasetsRepository) {
this.datasetsRepository = datasetsRepository
}
/**
* Returns all locks present in 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<DatasetLock[]>}
*/
async execute(datasetId: number | string): Promise<DatasetLock[]> {
return await this.datasetsRepository.getDatasetLocks(datasetId)
}
}