Skip to content

Commit 60662bc

Browse files
committed
Use the archiveNbr property for generating the banner image
The updateRootColumns endpoint uses the archiveNbr property to generate the image for the banner. The record object has both the archiveNbr and the archiveNumber, both having the same value. So we will be using the archiveNbr for consistency, because it is the correct property from RecordVO. Issue: PER-10392
1 parent 1351a76 commit 60662bc

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/app/core/components/profile-edit/profile-edit.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ describe('ProfileEditComponent', () => {
122122
thumbURL500: 'new500',
123123
thumbURL1000: 'new1000',
124124
thumbURL2000: 'new2000',
125-
}) as any;
126-
mockRecord.archiveNumber = 999;
125+
archiveNbr: 999,
126+
});
127127
mockFolderPickerService.chooseRecord.and.resolveTo(mockRecord);
128128

129129
await component.chooseBannerPicture();

src/app/core/components/profile-edit/profile-edit.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,17 @@ export class ProfileEditComponent implements OnInit, AfterViewInit {
149149
async chooseBannerPicture() {
150150
const originalValue = this.publicRoot.thumbArchiveNbr;
151151
try {
152-
const record = (await this.folderPicker.chooseRecord(
152+
const record = await this.folderPicker.chooseRecord(
153153
this.account.getPrivateRoot(),
154-
)) as any;
154+
);
155155
const updateFolder = new FolderVO(this.publicRoot);
156-
updateFolder.thumbArchiveNbr = record.archiveNumber;
156+
updateFolder.thumbArchiveNbr = record.archiveNbr;
157157
await this.api.folder.updateRoot(
158158
[updateFolder],
159159
['thumbArchiveNbr', 'view', 'viewProperty'],
160160
);
161161
// borrow thumb URLs from record for now, until they can be regenerated
162-
this.publicRoot.thumbArchiveNbr = record.archiveNumber;
162+
this.publicRoot.thumbArchiveNbr = record.archiveNbr;
163163
this.publicRoot.thumbURL200 = record.thumbURL200;
164164
this.publicRoot.thumbURL500 = record.thumbURL500;
165165
this.publicRoot.thumbURL1000 = record.thumbURL1000;

src/app/shared/services/profile/profile.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ export class ProfileService {
111111
const privateRoot = this.account.getPrivateRoot();
112112
try {
113113
const currentArchive = this.account.getArchive();
114-
const record = (await this.folderPicker.chooseRecord(privateRoot)) as any;
114+
const record = await this.folderPicker.chooseRecord(privateRoot);
115115
const updateArchive = new ArchiveVO(currentArchive);
116-
updateArchive.thumbArchiveNbr = record.archiveNumber;
116+
updateArchive.thumbArchiveNbr = record.archiveNbr;
117117

118118
updateArchive.thumbURL200 = record.thumbURL200;
119119
updateArchive.thumbURL500 = record.thumbURL500;

0 commit comments

Comments
 (0)