Skip to content

Commit 64dc16d

Browse files
committed
fix: review tweaks
1 parent f5037f7 commit 64dc16d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

docs/useCases.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,9 @@ const uploadedFileDTO: UploadedFileDTO = {
13591359
mimeType: 'text/plain'
13601360
}
13611361

1362-
replaceFile.execute(fileId, uploadedFileDTO)
1362+
replaceFile.execute(fileId, uploadedFileDTO).then((newFileId: number) => {
1363+
/* ... */
1364+
})
13631365

13641366
/* ... */
13651367
```
@@ -1370,6 +1372,8 @@ The `fileId` parameter can be a string, for persistent identifiers, or a number,
13701372

13711373
The `uploadedFileDTO` parameter is a [UploadedFileDTO](../src/files/domain/dtos/UploadedFileDTO.ts) and includes properties related to the uploaded files. Some of these properties should be calculated from the uploaded File Blob objects and the resulting storage identifiers from the Upload File use case.
13721374

1375+
The use case returns a number, which is the identifier of the new file.
1376+
13731377
#### Restrict or Unrestrict a File
13741378

13751379
Restrict or unrestrict an existing file.

src/files/infra/repositories/FilesRepository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { AxiosResponse } from 'axios'
12
import { ApiRepository } from '../../../core/infra/repositories/ApiRepository'
23
import { IFilesRepository } from '../../domain/repositories/IFilesRepository'
34
import { FileModel as FileModel } from '../../domain/models/FileModel'
@@ -20,7 +21,6 @@ import { transformUploadDestinationsResponseToUploadDestination } from './transf
2021
import { UploadedFileDTO } from '../../domain/dtos/UploadedFileDTO'
2122
import { UpdateFileMetadataDTO } from '../../domain/dtos/UpdateFileMetadataDTO'
2223
import { ApiConstants } from '../../../core/infra/repositories/ApiConstants'
23-
import { AxiosResponse } from 'axios'
2424

2525
export interface GetFilesQueryParams {
2626
includeDeaccessioned: boolean

test/integration/files/DirectUpload.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,6 @@ describe('Direct Upload', () => {
332332

333333
const replaceResponse = await filesRepositorySut.replaceFile(currentFileId, newUploadedFileDTO)
334334

335-
console.log({ replaceResponse })
336-
337335
// 4 - Verify that the new file is in the dataset and the old file is not
338336
datasetFiles = await filesRepositorySut.getDatasetFiles(
339337
testDataset3Ids.numericId,

0 commit comments

Comments
 (0)