Skip to content

Commit

Permalink
copy loan bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jawanbdarni committed Dec 1, 2024
1 parent 909aa1d commit fe384f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
5 changes: 4 additions & 1 deletion cloudapp/src/app/ILL/requestForm/requestForm.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ export class RequestFormComponent implements OnInit, OnChanges {
this.formRequesterInformation = initRequesterInformationFormGroup();
this.formRotamation = initRotaFormGroup();
this.storeService.get(SELECTED_REQUEST_TYPE).subscribe((value) => {
this.requestType =value;
if (!value || (value !== 'LOANO' && value !== 'COPYO')) {
this.requestType = 'COPYO';
} else{
this.requestType =value;}
});
this.storeService.get(SELECTED_RECORD_ILL).pipe(
mergeMap(fullRecordData =>{
Expand Down
18 changes: 6 additions & 12 deletions cloudapp/src/app/ILL/requestType/requestType.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,19 @@ export class RequestTypeComponent implements OnInit {
}

ngOnInit(): void {
this.storeService.get(SELECTED_REQUEST_TYPE).subscribe((value) => {
if (value === null || value === undefined || (value !== 'COPYO' && value !== 'LOANO')) {
this.selected = 'COPYO';
this.storeService.set(SELECTED_REQUEST_TYPE, this.selected).subscribe();
} else {
this.selected = value;
}
this.form.get('requestType')?.setValue(this.selected, { emitEvent: false });
this.storeService.set(SELECTED_REQUEST_TYPE, null).subscribe(() => {
this.selected = 'COPYO';
this.form.get('requestType')?.setValue(this.selected);
});

this.form.get('requestType')?.valueChanges.subscribe((value) => {
if (value) {
if (value && value !== this.selected) {
this.selected = value;
this.storeService.set(SELECTED_REQUEST_TYPE, this.selected).subscribe();
}
});
}


}

goNext(): void {
this.router.navigate(['ILLBorrowingMain']);
}
Expand Down

0 comments on commit fe384f7

Please sign in to comment.