From 03005ddb79e51def4ab201653bbd3426d09066b6 Mon Sep 17 00:00:00 2001 From: GPortas Date: Wed, 15 Nov 2023 10:32:43 +0000 Subject: [PATCH] Added: optimize get dataset call by adding includeFiles=false query param --- src/datasets/infra/repositories/DatasetsRepository.ts | 1 + test/unit/datasets/DatasetsRepository.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/datasets/infra/repositories/DatasetsRepository.ts b/src/datasets/infra/repositories/DatasetsRepository.ts index e2973c7e..55791700 100644 --- a/src/datasets/infra/repositories/DatasetsRepository.ts +++ b/src/datasets/infra/repositories/DatasetsRepository.ts @@ -36,6 +36,7 @@ export class DatasetsRepository extends ApiRepository implements IDatasetsReposi true, { includeDeaccessioned: includeDeaccessioned, + includeFiles: false }, ) .then((response) => transformVersionResponseToDataset(response)) diff --git a/test/unit/datasets/DatasetsRepository.test.ts b/test/unit/datasets/DatasetsRepository.test.ts index 204e681b..34844403 100644 --- a/test/unit/datasets/DatasetsRepository.test.ts +++ b/test/unit/datasets/DatasetsRepository.test.ts @@ -83,11 +83,11 @@ describe('DatasetsRepository', () => { describe('getDataset', () => { const testIncludeDeaccessioned = false; const expectedRequestConfigApiKey = { - params: { includeDeaccessioned: testIncludeDeaccessioned }, + params: { includeDeaccessioned: testIncludeDeaccessioned, includeFiles: false }, headers: TestConstants.TEST_EXPECTED_AUTHENTICATED_REQUEST_CONFIG_API_KEY.headers, }; const expectedRequestConfigSessionCookie = { - params: { includeDeaccessioned: testIncludeDeaccessioned }, + params: { includeDeaccessioned: testIncludeDeaccessioned, includeFiles: false }, withCredentials: TestConstants.TEST_EXPECTED_AUTHENTICATED_REQUEST_CONFIG_SESSION_COOKIE.withCredentials, headers: TestConstants.TEST_EXPECTED_AUTHENTICATED_REQUEST_CONFIG_SESSION_COOKIE.headers, };