Skip to content

Commit 49e7393

Browse files
committed
fix: minor changes
1 parent 7f7cf9c commit 49e7393

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docs/useCases.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,7 @@ deaccessionDataset.execute(datasetId, version, deaccessionDatasetDTO)
779779

780780
_See [use case](../src/datasets/domain/useCases/DeaccesionDataset.ts) implementation_.
781781
The `datasetId` parameter can be a string for persistent identifiers, or a number for numeric identifiers.
782-
The `version` parameter should be a string or a [DatasetNotNumberedVersion](../src/datasets/domain/models/DatasetNotNumberedVersion.ts) enum value. If not set, the default value is `DatasetNotNumberedVersion.LATEST`.
783-
In `deaccessionDatasetDTO`, deaccessionForwardURL is optional.
782+
The `version` parameter should be a string or a [DatasetNotNumberedVersion](../src/datasets/domain/models/DatasetNotNumberedVersion.ts) enum value.
784783

785784
You cannot deaccession a dataset more than once. If you call this endpoint twice for the same dataset version, you will get a not found error on the second call, since the dataset you are looking for will no longer be published since it is already deaccessioned.
786785

src/datasets/domain/useCases/DeaccessionDataset.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ export class DeaccessionDataset implements UseCase<void> {
1313
/**
1414
* Deaccession a dataset, given a dataset id, a dataset version id, and a DatasetDeaccessionDTO object.
1515
* @param {number | string} [datasetId] - The dataset identifier, which can be a string (for persistent identifiers), or a number (for numeric identifiers).
16-
* @param {string | DatasetNotNumberedVersion} [datasetVersionId=DatasetNotNumberedVersion.LATEST] - The dataset version identifier, which can be a version-specific numeric string (for example, 1.0) or a DatasetNotNumberedVersion enum value. If this parameter is not set, the default value is: DatasetNotNumberedVersion.LATEST
17-
* @param {DatasetDeaccessionDTO} [DatasetDeaccessionDTO] - The DatasetDeaccessionDTO object that contains the deaccession reason and an optional deaccession forward URL.
16+
* @param {string | DatasetNotNumberedVersion} [datasetVersionId] - The dataset version identifier, which can be a version-specific numeric string (for example, 1.0) or a DatasetNotNumberedVersion enum value.
1817
* @returns A promise that resolves when the dataset is deaccessioned
1918
* @throws An error if the dataset could not be deaccessioned
2019
*/
2120
async execute(
2221
datasetId: number | string,
23-
datasetVersionId: string | DatasetNotNumberedVersion = DatasetNotNumberedVersion.LATEST,
22+
datasetVersionId: string | DatasetNotNumberedVersion,
2423
DatasetDeaccessionDTO: DatasetDeaccessionDTO
2524
): Promise<void> {
2625
return await this.datasetsRepository.deaccessionDataset(

test/functional/datasets/DeaccessionDataset.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ describe('execute', () => {
120120
testDeaccessionDataset
121121
)
122122
).rejects.toBeInstanceOf(WriteError)
123+
124+
await deletePublishedDatasetViaApi(createdDatasetIdentifiers.persistentId)
123125
})
124126

125127
test('should deaccession a dataset when it is deaccessioned once', async () => {

0 commit comments

Comments
 (0)