fix: Improve checkout data handling in response processing
This commit is contained in:
parent
de98623ee0
commit
6d8af7f8fb
1 changed files with 2 additions and 2 deletions
|
|
@ -626,9 +626,9 @@ class MainWindow(QMainWindow):
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
console.log('[Checkout Check] Full data:', JSON.stringify(data));
|
console.log('[Checkout Check] Full data:', JSON.stringify(data));
|
||||||
console.log('[Checkout Check] Checkout field:', data.checkout);
|
console.log('[Checkout Check] Checkout field:', data.checkout);
|
||||||
const hasCheckout = data.checkout && Object.keys(data.checkout).length > 0;
|
const hasCheckout = !!(data.checkout && Object.keys(data.checkout).length > 0);
|
||||||
console.log('[Checkout Check] Has checkout:', hasCheckout);
|
console.log('[Checkout Check] Has checkout:', hasCheckout);
|
||||||
window['{callback_id}'] = JSON.stringify({{ checkout: data.checkout, hasCheckout: hasCheckout }});
|
window['{callback_id}'] = JSON.stringify({{ checkout: data.checkout || null, hasCheckout: hasCheckout }});
|
||||||
}} else {{
|
}} else {{
|
||||||
console.log('[Checkout Check] Failed to fetch, status:', response.status);
|
console.log('[Checkout Check] Failed to fetch, status:', response.status);
|
||||||
window['{callback_id}'] = JSON.stringify({{ error: 'Failed to fetch asset', status: response.status }});
|
window['{callback_id}'] = JSON.stringify({{ error: 'Failed to fetch asset', status: response.status }});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue