79451190

Date: 2025-02-19 11:45:55
Score: 0.5
Natty:
Report link

the problem was that my if statement:

if (envoi?.paid && envoi?.trackingNumber && envoi?.qrCodeUrl && envoi?.simulationStatus === SimulationStatus.COMPLETED)

which doesn't run because my api backend return an object that contains another object, the soulution i should change my if statement for exemple to be: if(envoi?.envoi.paid) instead of: if(envoi?.paid) Or, update the api response to return directly the 'envoi' object instead of returning it in another object like i had before : return NextResponse.json({envoi: envoi}, {status: 200});

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Just Relax قناة هدوء