} catch (error) {
console.error('Error:', error);
res.status(400).send({ error: error.message });
}
}); when i hit this api on postman ("/offersPolicies?sku=MG39-E29") the response was bad request and the error in message is show is ("{
"error": "This is an invalid value for a SKU. Only alphanumeric characters can be used for SKUs, and their length must not exceed 50 characters"
}") please guide me
app.get('/offersPolicies', async function (req, res) { try {
// const isValidSku = /^[a-zA-Z0-9]{1,50}$/.test(viewItemSku); // if (!isValidSku) { // return res.status(400).send({ error: 'Invalid SKU format' }); // }
} catch (error) { console.error('Error:', error); res.status(400).send({ error: error.message }); } }); when i hit this api on postman ("/offersPolicies?sku=MG39-E29") the response was bad request and the error in message is show is ("{ "error": "This is an invalid value for a SKU. Only alphanumeric characters can be used for SKUs, and their length must not exceed 50 characters" }") please guide me