明树Git Lab

Commit 0e282764 authored by zfp1's avatar zfp1

update

parent b3aa7bc0
......@@ -14,7 +14,7 @@ async function findCompInfo(req, res, next) {
async function updateCompInfo(req, res, next) {
try {
let body = req.body;
body.companyInfoImgs = (body.companyInfoImgs || []).map(o => {return o && o._id});
body.companyInfoImgs = (body.companyInfoImgs || []).map(o => {return o && o._id || o});
return await DB.CompanyInfo.findOneAndUpdate({_id: body._id},{body});
} catch (error) {
next(error);
......
......@@ -5,7 +5,7 @@ async function createDeepPlant(req, res, next) {
const body = req.body;
let count = await DB.ProductDeep.countDocuments(); //没有真实删除 永远递增
body.productNumber = count;
body.qualityInsReportImgs = (body.qualityInsReportImgs || []).map(o => {return o && o._id});
body.qualityInsReportImgs = (body.qualityInsReportImgs || []).map(o => {return o && o._id || o});
let ret = await DB.ProductDeep.create(body);
res.sendData(ret);
} catch (error) {
......
......@@ -5,7 +5,7 @@ async function createDirectPlant(req, res, next) {
const body = req.body;
let count = await DB.ProductPlant.countDocuments(); //没有真实删除 永远递增
body.productNumber = count;
body.qualityInsReportImgs = (body.qualityInsReportImgs || []).map(o => {return o && o._id});
body.qualityInsReportImgs = (body.qualityInsReportImgs || []).map(o => {return o && o._id || o});
let ret = await DB.ProductPlant.create(body);
res.sendData(ret);
} catch (error) {
......
......@@ -6,7 +6,7 @@ async function createPrePlant(req, res, next) {
const body = req.body;
let count = await DB.ProductPre.countDocuments(); //没有真实删除 永远递增
body.productNumber = count;
body.qualityInsReportImgs = (body.qualityInsReportImgs || []).map(o => {return o && o._id});
body.qualityInsReportImgs = (body.qualityInsReportImgs || []).map(o => {return o && o._id || o});
let ret = await DB.ProductPre.create(body);
res.sendData(ret);
} catch (error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment