Skip to content

Commit bdbad69

Browse files
committed
fix(collections): fix comment
1 parent db3bcf2 commit bdbad69

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎src/app/features/collections/components/add-to-collection/add-to-collection-confirmation-dialog/add-to-collection-confirmation-dialog.component.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { CedarMetadataRecordData, CedarRecordDataBinding } from '@osf/features/m
1515
import { CreateCedarMetadataRecord, UpdateCedarMetadataRecord } from '@osf/features/metadata/store';
1616
import { UpdateProjectPublicStatus } from '@osf/features/project/overview/store';
1717
import { ResourceType } from '@osf/shared/enums/resource-type.enum';
18+
import { ProjectModel } from '@osf/shared/models/projects/projects.model';
1819
import { ToastService } from '@osf/shared/services/toast.service';
1920

2021
@Component({
@@ -39,23 +40,23 @@ export class AddToCollectionConfirmationDialogComponent {
3940

4041
handleAddToCollectionConfirm(): void {
4142
const payload = this.config.data.payload;
42-
const project = this.config.data.project;
43+
const project = this.config.data.project as ProjectModel | null | undefined;
4344
const cedarData = this.config.data.cedarData as CedarRecordDataBinding | null | undefined;
4445
const existingCedarRecord = this.config.data.existingCedarRecord as CedarMetadataRecordData | null | undefined;
4546

4647
if (!payload || !project) return;
4748

4849
this.isSubmitting.set(true);
49-
const projectPayload = [{ id: project.id as string, public: true }];
50+
const projectPayload = [{ id: project.id, public: true }];
5051

5152
const updatePublicStatus$: Observable<unknown> = project.isPublic
5253
? of(null)
5354
: this.actions.updateProjectPublicStatus(projectPayload);
5455

5556
const saveCedar$: Observable<unknown> = cedarData
5657
? existingCedarRecord
57-
? this.actions.updateCedarRecord(cedarData, existingCedarRecord.id!, project.id as string, ResourceType.Project)
58-
: this.actions.createCedarRecord(cedarData, project.id as string, ResourceType.Project)
58+
? this.actions.updateCedarRecord(cedarData, existingCedarRecord.id!, project.id, ResourceType.Project)
59+
: this.actions.createCedarRecord(cedarData, project.id, ResourceType.Project)
5960
: of(null);
6061

6162
updatePublicStatus$

0 commit comments

Comments
 (0)