diff --git a/src/controllers/storeController.js b/src/controllers/storeController.js index 9cedc427..67accda7 100644 --- a/src/controllers/storeController.js +++ b/src/controllers/storeController.js @@ -1188,13 +1188,13 @@ const generateBatchNo = (type, hardwareIdCompany) => { const companyPrefix = hardwareIdCompany.slice(0, 2).toUpperCase(); const randomNumbers = Math.floor(100 + Math.random() * 900).toString(); // 3 random digits - if (type === 'slave') { + if (type === 'SLAVE') { return `SL${ddmmyy}${companyPrefix}${randomNumbers}`; } - if (type === 'master') { + if (type === 'MASTER') { return `MA${ddmmyy}${companyPrefix}${randomNumbers}`; } - if (type === 'motor_switch') { + if (type === 'MOTOR_SWITCH') { return `MS${ddmmyy}${companyPrefix}${randomNumbers}`; } // Add other type conditions if needed @@ -1202,7 +1202,7 @@ const generateBatchNo = (type, hardwareIdCompany) => { }; exports.createSensor = async (req, reply) => { - try { + try { const storeId = req.params.storeId; const { indate, batchno, hardwareId_company, quantity, model, type } = req.body;