dynamic + check for statuss 200

This commit is contained in:
2026-05-13 14:35:50 +04:00
parent 5147d05ea2
commit 0330e0a212

View File

@@ -176,7 +176,7 @@ export class CreatePage {
this.stopPolling(); this.stopPolling();
this.qrPolling.set(true); this.qrPolling.set(true);
this.pollHandle = setInterval(() => { this.pollHandle = setInterval(() => {
this.http.get<QrStatusResponse>(`${QR_VITANOVA_API}/qr/${encodeURIComponent(this.partnerqrID)}/${qrId}/`) this.http.get<QrStatusResponse>(`${QR_VITANOVA_API}/qr/dynamic/${encodeURIComponent(this.partnerqrID)}/${qrId}/`)
.subscribe({ .subscribe({
next: (res) => { next: (res) => {
const st = res?.status ?? ''; const st = res?.status ?? '';
@@ -191,7 +191,9 @@ export class CreatePage {
} }
// REGISTERED / NEW / '' — keep polling // REGISTERED / NEW / '' — keep polling
}, },
error: () => undefined error: () => {
this.stopPolling();
}
}); });
}, 5000); }, 5000);
} }