response
This commit is contained in:
@@ -16,11 +16,15 @@ interface WebSessionResponse {
|
||||
}
|
||||
|
||||
interface CheckFastcheckResponse {
|
||||
fastcheck: string;
|
||||
amount?: number; // not in doc but server may include it
|
||||
expiration: string;
|
||||
Status: boolean;
|
||||
message?: string;
|
||||
id: string;
|
||||
code: string;
|
||||
owneID: string;
|
||||
amount: number;
|
||||
currency: string;
|
||||
createdAt: string;
|
||||
creattransactionID: string;
|
||||
firedAT: string;
|
||||
firetransactionID: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@@ -241,20 +245,17 @@ export class FastcheckPage {
|
||||
this.fastcheckAmount.set(null);
|
||||
this.codeEnabled.set(false);
|
||||
|
||||
// API doc: GET /fastcheck with fastcheck as query param
|
||||
// API doc: GET /fastcheck/<id>
|
||||
this.http
|
||||
.get<CheckFastcheckResponse>(`${FASTCHECK_API}/fastcheck`, {
|
||||
params: { fastcheck: number }
|
||||
})
|
||||
.get<CheckFastcheckResponse>(`${FASTCHECK_API}/fastcheck/${number}`)
|
||||
.subscribe({
|
||||
next: (res) => {
|
||||
this.amountLoading.set(false);
|
||||
if (res?.Status) {
|
||||
// amount may or may not be in response — show if present
|
||||
if (res?.id) {
|
||||
this.fastcheckAmount.set(typeof res.amount === 'number' ? res.amount : null);
|
||||
this.codeEnabled.set(true);
|
||||
} else {
|
||||
this.error.set(res?.message ?? this.t('errors.not_found'));
|
||||
this.error.set(this.t('errors.not_found'));
|
||||
this.lastLookedUpNumber = '';
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user