undo server code

This commit is contained in:
Selvi 2026-06-22 19:44:59 +05:30
parent 8017040708
commit a6b29d98eb

View File

@ -206,10 +206,14 @@ app.post('/create-order', async (req, res) => {
}
};
orderPayload.order.note_attributes = [
{ name: "Contact Number", value: customerData.contact_number || "" },
{ name: "Courier", value: customerData.courier || "" }
];
if (customerData.contact_phone || customerData.contactNumber || customerData.contact_number) {
orderPayload.order.note_attributes = [
{
name: 'Contact Number',
value: customerData.contact_phone || customerData.contactNumber || customerData.contact_number
}
];
}
const shopifyResponse = await fetch(`https://${process.env.SHOPIFY_STORE_DOMAIN}/admin/api/2024-01/orders.json`, {
method: 'POST',