Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed SERVER_API_URL constants from account calls as a test #1052

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ui/src/app/account/service/account.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core'
import { SessionStorageService } from 'ngx-webstorage'
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'
import { BehaviorSubject, EMPTY, Observable, Subject, catchError, map, of, takeUntil, tap } from 'rxjs'

Check warning on line 4 in ui/src/app/account/service/account.service.ts

View workflow job for this annotation

GitHub Actions / format

'of' is defined but never used

Check warning on line 4 in ui/src/app/account/service/account.service.ts

View workflow job for this annotation

GitHub Actions / format

'tap' is defined but never used

import { SERVER_API_URL } from '../../../app/app.constants'
import { IAccount } from '../model/account.model'
Expand All @@ -14,7 +14,7 @@
private isFetchingAccountData = false
private stopFetchingAccountData = new Subject()
private authenticated = false
private authenticationState = new BehaviorSubject<any>(null)

Check warning on line 17 in ui/src/app/account/service/account.service.ts

View workflow job for this annotation

GitHub Actions / format

Unexpected any. Specify a different type
private logoutAsResourceUrl = SERVER_API_URL + 'services/userservice/api'

constructor(
Expand All @@ -28,7 +28,7 @@
console.log('Fetching account data from the back end')

return this.http
.get<IAccount>(SERVER_API_URL + '/services/userservice/api/account', {
.get<IAccount>('/services/userservice/api/account', {
observe: 'response',
})
.pipe(
Expand Down Expand Up @@ -69,19 +69,19 @@
}

getMfaSetup(): Observable<HttpResponse<any>> {
return this.http.get<any>(SERVER_API_URL + 'services/userservice/api/account/mfa', { observe: 'response' })
return this.http.get<any>('/services/userservice/api/account/mfa', { observe: 'response' })
}

save(account: any): Observable<HttpResponse<any>> {
return this.http.post(SERVER_API_URL + 'services/userservice/api/account', account, { observe: 'response' })
return this.http.post('/services/userservice/api/account', account, { observe: 'response' })
}

enableMfa(mfaSetup: any): Observable<HttpResponse<any>> {
return this.http.post(SERVER_API_URL + 'services/userservice/api/account/mfa/on', mfaSetup, { observe: 'response' })
return this.http.post('/services/userservice/api/account/mfa/on', mfaSetup, { observe: 'response' })
}

disableMfa(): Observable<HttpResponse<any>> {
return this.http.post(SERVER_API_URL + 'services/userservice/api/account/mfa/off', null, { observe: 'response' })
return this.http.post('/services/userservice/api/account/mfa/off', null, { observe: 'response' })
}
// TODO: any - this seems to only be used for logging out (only ever receives null as arg)
authenticate(identity: any) {
Expand Down
Loading