Skip to content

Commit 9c912e7

Browse files
committed
Refactored endpoint constants
1 parent a64b80e commit 9c912e7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/app/core/services/verifier-endpoint.service.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { SessionStorageService } from './session-storage.service';
1616
const SAME_DEVICE_UI_RE_ENTRY_URL = '/get-wallet-code?response_code={RESPONSE_CODE}';
1717
const PRESENTATIONS_ENDPOINT = 'ui/presentations';
1818
const PRESENTATIONS_ENDPOINT_V2 = 'ui/presentations/v2';
19+
const WALLET_RESPONSE_ENDPOINT = 'ui/presentations/${transactionId}';
20+
const EVENTS_ENDPOINT = 'ui/presentations/${transactionId}/events';
1921
const VALIDATE_SD_JWT_VC_PRESENTATION_ENDPOINT = 'utilities/validations/sdJwtVc';
2022

2123
@Injectable()
@@ -50,14 +52,14 @@ export class VerifierEndpointService {
5052

5153
getWalletResponse(transaction_id: string, code?: string): Observable<WalletResponse> {
5254
if (typeof code == 'undefined') {
53-
return this.httpService.get(PRESENTATIONS_ENDPOINT+`/${transaction_id}`);
55+
return this.httpService.get(WALLET_RESPONSE_ENDPOINT.replace('${transactionId}', transaction_id));
5456
} else {
55-
return this.httpService.get(PRESENTATIONS_ENDPOINT+`/${transaction_id}?response_code=${code}`);
57+
return this.httpService.get(WALLET_RESPONSE_ENDPOINT.replace('${transactionId}', transaction_id) + `?response_code=${code}`);
5658
}
5759
}
5860

5961
getsTransactionEventsLogs(transactionId: string): Observable<EventLog[]> {
60-
return this.httpService.get(PRESENTATIONS_ENDPOINT+`/${transactionId}/events`)
62+
return this.httpService.get(EVENTS_ENDPOINT.replace('${transactionId}', transactionId))
6163
.pipe(
6264
map((data: any) => {
6365
return data.events.map((event: EventLog) => {

0 commit comments

Comments
 (0)