changes in store

master^2
Varun 8 months ago
parent 5c925c25e0
commit 3c2a2220f6

@ -1183,7 +1183,7 @@ exports.updateSensorById = async (req, reply) => {
const filteredUpdateData = Object.keys(updateData) const filteredUpdateData = Object.keys(updateData)
.filter((key) => allowedFields.includes(key)) .filter((key) => allowedFields.includes(key))
.reduce((obj, key) => { .reduce((obj, key) => {
obj[key] = key === "type" ? updateData[key].toLowerCase() : updateData[key]; obj[key] = key === "type" ? updateData[key].toUpperCase() : updateData[key];
return obj; return obj;
}, {}); }, {});
@ -1296,8 +1296,8 @@ const generateBatchNo = (type, hardwareIdCompany) => {
exports.createSensor = async (req, reply) => { exports.createSensor = async (req, reply) => {
try { try {
const storeId = req.params.storeId; const storeId = req.params.storeId;
const { indate, batchno, hardwareId_company, quantity, model, type } = req.body; const { indate, batchno, hardwareId_company, quantity, model,type } = req.body;
const sensorType = type.toLowerCase();
let finalBatchNo = batchno; let finalBatchNo = batchno;
if (batchno === 'New') { if (batchno === 'New') {
@ -1322,7 +1322,7 @@ exports.createSensor = async (req, reply) => {
storeId, storeId,
model, model,
batchno: finalBatchNo, batchno: finalBatchNo,
type, type: sensorType,
indate, indate,
hardwareId_company hardwareId_company
}; };

Loading…
Cancel
Save