Skip to content

Commit f3e57b1

Browse files
committed
[PER-10107] Fixed record call to get with token
1 parent 9c00677 commit f3e57b1

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

src/app/file-browser/components/file-list/file-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ export class FileListComponent
527527
});
528528
}
529529

530-
let itemsToFetch = visibleListItems.map((c) => c.item);
530+
const itemsToFetch = visibleListItems.map((c) => c.item);
531531
if (itemsToFetch.length) {
532532
await this.dataService.fetchLeanItems(itemsToFetch);
533533
}

src/app/file-browser/components/file-viewer/file-viewer.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export class FileViewerComponent implements OnInit, OnDestroy {
138138
) && !this.route.snapshot.data?.isPublicArchive;
139139

140140
if (this.isUnlistedShare) {
141-
const response = await this.api.record.getWithShareTokenAuth(
141+
const response = await this.api.record.get(
142142
[this.currentRecord.recordId],
143143
this.shareLinksService.currentShareToken,
144144
);

src/app/shared/services/api/folder.repo.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export class FolderRepo extends BaseRepo {
177177
folderIds: [folderVO.folderId],
178178
};
179179
let options = {};
180-
if(shareToken) {
180+
if (shareToken) {
181181
options = {
182182
authToken: false,
183183
shareToken,
@@ -204,7 +204,7 @@ export class FolderRepo extends BaseRepo {
204204
pageSize: 99999999, // We want all results in one request
205205
};
206206
let options = {};
207-
if(shareToken) {
207+
if (shareToken) {
208208
options = {
209209
authToken: false,
210210
shareToken,
@@ -216,7 +216,7 @@ export class FolderRepo extends BaseRepo {
216216
`v2/folder/${folderVO.folderId}/children`,
217217
queryData,
218218
null,
219-
options
219+
options,
220220
),
221221
)
222222
)[0];

src/app/shared/services/api/record.repo.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ export class RecordRepo extends BaseRepo {
202202
const recordVo = recordResponse.getRecordVO();
203203
return recordVo.recordId;
204204
}
205-
public async get(recordVOs: RecordVO[], shareToken: string | null = null): Promise<RecordResponse> {
205+
public async get(
206+
recordVOs: RecordVO[],
207+
shareToken: string | null = null,
208+
): Promise<RecordResponse> {
206209
const recordIds = await Promise.all(
207210
// There are some flows (e.g. published records) where only the archiveNbr is known.
208211
// In those cases, we need to look up the recordId first since stela API has phased
@@ -217,7 +220,7 @@ export class RecordRepo extends BaseRepo {
217220
recordIds,
218221
};
219222
let options = {};
220-
if(shareToken) {
223+
if (shareToken) {
221224
options = {
222225
authToken: false,
223226
shareToken,

src/app/shared/services/data/data.service.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ describe('DataService', () => {
135135
expect(httpV2Service.get).toHaveBeenCalledWith(
136136
'v2/record',
137137
jasmine.any(Object),
138+
null,
139+
jasmine.any(Object),
138140
);
139141
records.forEach((item) => {
140142
expect(item.dataStatus).toEqual(DataStatus.Full);

0 commit comments

Comments
 (0)