mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-06 18:31:00 +00:00
fix returning response
This commit is contained in:
parent
4a5e427b26
commit
393623c4c0
@ -78,18 +78,16 @@ export default async function handler(req, res) {
|
|||||||
settled: false
|
settled: false
|
||||||
}, { ex: expiry || 86400 });
|
}, { ex: expiry || 86400 });
|
||||||
|
|
||||||
// Trigger the polling endpoint
|
// Trigger the polling endpoint without waiting for it
|
||||||
try {
|
fetch(`${BACKEND_URL}/api/invoices/short-poll`, {
|
||||||
await axios.get(`${BACKEND_URL}/api/invoices/short-poll`, {
|
headers: {
|
||||||
headers: {
|
'Authorization': PLEBDEVS_API_KEY
|
||||||
'Authorization': PLEBDEVS_API_KEY
|
}
|
||||||
}
|
}).catch(error => {
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error triggering polling:', error);
|
console.error('Error triggering polling:', error);
|
||||||
// Continue even if polling fails
|
});
|
||||||
}
|
|
||||||
|
|
||||||
|
// Return response immediately
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
invoice,
|
invoice,
|
||||||
payment_hash: paymentHashHex,
|
payment_hash: paymentHashHex,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user