diff --git a/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.ts b/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.ts index 0f8813e1e17..66a8acf6519 100644 --- a/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.ts +++ b/src/web/app/pages-instructor/instructor-sessions-page/instructor-sessions-page.component.ts @@ -10,6 +10,7 @@ import { CopyFromOtherSessionsModalComponent } from './copy-from-other-sessions- import { SessionPermanentDeletionConfirmModalComponent } from './session-permanent-deletion-confirm-modal/session-permanent-deletion-confirm-modal.component'; import { SessionsPermanentDeletionConfirmModalComponent } from './sessions-permanent-deletion-confirm-modal/sessions-permanent-deletion-confirm-modal.component'; import { CourseService } from '../../../services/course.service'; +import { QueryParamKeys } from '../../../types/api-const'; import { Course, FeedbackQuestion, @@ -120,7 +121,7 @@ export class InstructorSessionsPageComponent extends InstructorSessionModalPageC } ngOnInit(): void { this.route.queryParams.subscribe((queryParams: Params) => { - this.courseId = queryParams['courseid']; + this.courseId = queryParams[QueryParamKeys.COURSE_ID]; }); this.isSessionEditFormExpanded = !!this.courseId; diff --git a/src/web/app/user-join-page.component.ts b/src/web/app/user-join-page.component.ts index 9a8a756555d..09695d5516e 100644 --- a/src/web/app/user-join-page.component.ts +++ b/src/web/app/user-join-page.component.ts @@ -8,6 +8,7 @@ import { AuthService } from '../services/auth.service'; import { CourseService } from '../services/course.service'; import { NavigationService } from '../services/navigation.service'; import { SimpleModalService } from '../services/simple-modal.service'; +import { QueryParamKeys } from '../types/api-const'; import { AuthInfo, CourseJoinKeyAccess, CourseJoinKeyAccessDecision } from '../types/api-output'; import { LoadingSpinnerDirective } from './components/loading-spinner/loading-spinner.directive'; @@ -37,13 +38,13 @@ export class UserJoinPageComponent implements OnInit { ngOnInit(): void { this.route.queryParams.subscribe((queryParams: Params) => { this.entityType = queryParams['entityType']; - this.key = queryParams['key']; + this.key = queryParams[QueryParamKeys.KEY]; const nextUrl = `${globalThis.location.pathname}${globalThis.location.search.replaceAll('&', '%26')}`; this.authService.getAuthUser().subscribe((auth: AuthInfo) => { if (!auth.user) { this.isLoading = false; - this.navigationService.navigateByURL(`/web/login?nextUrl=${encodeURIComponent(nextUrl)}`); + this.navigationService.navigateByURL(`/web/login?${QueryParamKeys.NEXT_URL}=${encodeURIComponent(nextUrl)}`); return; } this.accountEmail = auth.user.accountEmail; @@ -55,7 +56,9 @@ export class UserJoinPageComponent implements OnInit { this.navigationService.navigateByURL(`/web/${this.entityType}`); break; case CourseJoinKeyAccessDecision.SIGN_IN_REQUIRED: - this.navigationService.navigateByURL(`/web/login?nextUrl=${encodeURIComponent(nextUrl)}`); + this.navigationService.navigateByURL( + `/web/login?${QueryParamKeys.NEXT_URL}=${encodeURIComponent(nextUrl)}`, + ); break; case CourseJoinKeyAccessDecision.VALID: this.hasJoined = false; diff --git a/src/web/services/account.service.ts b/src/web/services/account.service.ts index f977e1ba435..ec23fe449bb 100644 --- a/src/web/services/account.service.ts +++ b/src/web/services/account.service.ts @@ -134,7 +134,7 @@ export class AccountService { paramMap['instituteid'] = queryParams.instituteId; } if (queryParams.accountId) { - paramMap['accountid'] = queryParams.accountId; + paramMap[QueryParamKeys.ACCOUNT_ID] = queryParams.accountId; } if (queryParams.status) { paramMap['status'] = queryParams.status; diff --git a/src/web/services/institute.service.ts b/src/web/services/institute.service.ts index b58e3c98823..a0028ac87b1 100644 --- a/src/web/services/institute.service.ts +++ b/src/web/services/institute.service.ts @@ -1,7 +1,7 @@ import { Injectable, inject } from '@angular/core'; import { Observable } from 'rxjs'; import { HttpRequestService } from './http-request.service'; -import { ResourceEndpoints } from '../types/api-const'; +import { QueryParamKeys, ResourceEndpoints } from '../types/api-const'; import { Institutes } from '../types/api-output'; /** @@ -17,6 +17,6 @@ export class InstituteService { * Gets the institutes for which the given account has been verified. */ getVerifiedInstitutes(accountId: string): Observable { - return this.httpRequestService.get(ResourceEndpoints.INSTITUTES, { accountid: accountId }); + return this.httpRequestService.get(ResourceEndpoints.INSTITUTES, { [QueryParamKeys.ACCOUNT_ID]: accountId }); } } diff --git a/src/web/services/instructor.service.ts b/src/web/services/instructor.service.ts index 929d7b375e2..f31b91f466e 100644 --- a/src/web/services/instructor.service.ts +++ b/src/web/services/instructor.service.ts @@ -113,7 +113,7 @@ export class InstructorService { if ('courseId' in queryParams) { paramMap[QueryParamKeys.COURSE_ID] = queryParams.courseId; } else { - paramMap['userid'] = queryParams.userId; + paramMap[QueryParamKeys.USER_ID] = queryParams.userId; } return this.httpRequestService.get(ResourceEndpoints.INSTRUCTOR_PRIVILEGE, paramMap); diff --git a/src/web/services/log.service.ts b/src/web/services/log.service.ts index 13de14ccbf9..c5f05fac973 100644 --- a/src/web/services/log.service.ts +++ b/src/web/services/log.service.ts @@ -52,7 +52,7 @@ export class LogService { }; if (queryParams.userId) { - paramMap['userid'] = queryParams.userId; + paramMap[QueryParamKeys.USER_ID] = queryParams.userId; } if (queryParams.sessionId) { diff --git a/src/web/services/student.service.ts b/src/web/services/student.service.ts index 6ac72aadfbf..74d362cd0a6 100644 --- a/src/web/services/student.service.ts +++ b/src/web/services/student.service.ts @@ -29,7 +29,7 @@ export class StudentService { const paramsMap: { [key: string]: string | string[] } = {}; if (queryParams.courseIds !== undefined) { - paramsMap['courseid'] = queryParams.courseIds; + paramsMap[QueryParamKeys.COURSE_ID] = queryParams.courseIds; } if (queryParams.searchKey !== undefined) { paramsMap[QueryParamKeys.SEARCH_KEY] = queryParams.searchKey;