Skip to content

Commit eec4002

Browse files
committed
Minor updates to leverage functionality
1 parent 63679da commit eec4002

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

cloudapp/src/app/configuration/configuration.component.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,7 @@ export class ConfigurationGuard implements CanActivate {
6565

6666
canActivate(): Observable<boolean> {
6767
return this.eventsService.getInitData().pipe(
68-
/* Until primaryId is available: */
69-
switchMap(data => iif(() =>
70-
data.user.primaryId==null,
71-
this.restService.call(`/users?q=${query(data)}`).pipe(
72-
map( resp => resp.user[0].primary_id )
73-
),
74-
of(data.user.primaryId)
75-
)),
76-
switchMap( primaryId => this.restService.call(`/users/${primaryId}`)),
68+
switchMap( initData => this.restService.call(`/users/${initData.user.primaryId}`)),
7769
map( user => {
7870
if (!user.user_role.some(role=>role.role_type.value=='221')) {
7971
this.router.navigate(['/error'],
@@ -84,7 +76,4 @@ export class ConfigurationGuard implements CanActivate {
8476
})
8577
);
8678
}
87-
}
88-
89-
const query = (data: InitData) => `first_name~${q(data.user.firstName)}+AND+last_name~${q(data.user.lastName)}`;
90-
const q = val => encodeURIComponent(val.replace(' ', '+'));
79+
}

cloudapp/src/app/xml/bib-utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ export class BibUtils {
1919
}
2020

2121
/** Retrieve a single BIB record */
22-
getBib (mmsId: string): Observable<Bib> {
23-
return this._restService.call(`/bibs/${mmsId}`);
22+
getBib (mmsId: string) {
23+
return this._restService.call<Bib>(`/bibs/${mmsId}`);
2424
}
2525

2626
/** Update a BIB record with the specified MARCXML */
27-
updateBib( bib: Bib ): Observable<Bib> {
28-
return this._restService.call( {
27+
updateBib( bib: Bib ) {
28+
return this._restService.call<Bib>( {
2929
url: `/bibs/${bib.mms_id}`,
3030
headers: {
3131
"Content-Type": "application/xml",

0 commit comments

Comments
 (0)