Skip to content

Commit 52de73d

Browse files
authored
Fixed events endpoint (#219)
* Fixed events endpoint * Refactored endpoint constants * Refactored endpoint constants
1 parent 9672a64 commit 52de73d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import {ActiveTransaction} from "@core/models/ActiveTransaction";
1414
import { SessionStorageService } from './session-storage.service';
1515

1616
const SAME_DEVICE_UI_RE_ENTRY_URL = '/get-wallet-code?response_code={RESPONSE_CODE}';
17-
const PRESENTATIONS_ENDPOINT = 'ui/presentations/v2';
17+
const INIT_TRANSACTION_ENDPOINT = 'ui/presentations/v2';
18+
const WALLET_RESPONSE_ENDPOINT = 'ui/presentations/${transactionId}';
19+
const EVENTS_ENDPOINT = 'ui/presentations/${transactionId}/events';
1820
const VALIDATE_SD_JWT_VC_PRESENTATION_ENDPOINT = 'utilities/validations/sdJwtVc';
1921

2022
@Injectable()
@@ -34,7 +36,7 @@ export class VerifierEndpointService {
3436
if (!this.deviceDetectorService.isDesktop()) {
3537
payload['wallet_response_redirect_uri_template'] = location.origin + SAME_DEVICE_UI_RE_ENTRY_URL;
3638
}
37-
this.httpService.post<InitializedTransaction, string>(PRESENTATIONS_ENDPOINT, payload)
39+
this.httpService.post<InitializedTransaction, string>(INIT_TRANSACTION_ENDPOINT, payload)
3840
.pipe(
3941
tap((res) => {
4042
let activeTransaction : ActiveTransaction = {
@@ -49,14 +51,14 @@ export class VerifierEndpointService {
4951

5052
getWalletResponse(transaction_id: string, code?: string): Observable<WalletResponse> {
5153
if (typeof code == 'undefined') {
52-
return this.httpService.get(PRESENTATIONS_ENDPOINT+`/${transaction_id}`);
54+
return this.httpService.get(WALLET_RESPONSE_ENDPOINT.replace('${transactionId}', transaction_id));
5355
} else {
54-
return this.httpService.get(PRESENTATIONS_ENDPOINT+`/${transaction_id}?response_code=${code}`);
56+
return this.httpService.get(WALLET_RESPONSE_ENDPOINT.replace('${transactionId}', transaction_id) + `?response_code=${code}`);
5557
}
5658
}
5759

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

src/app/features/presentation-request-preparation/components/presentation-options/presentation-options.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@
3131
}
3232

3333
.request-options-control {
34-
display: flex;
3534
flex-direction: column;
3635
gap: 8px;
3736
}
3837

39-
@media (max-width: 768px) {
38+
@media (max-width: 576px) {
4039
.request-options-row {
4140
grid-template-columns: 1fr;
4241
}

0 commit comments

Comments
 (0)