明树Git Lab

Commit 47a41c6d authored by zfp1's avatar zfp1

update

parent 2fcce280
......@@ -15,6 +15,14 @@ async function updateCompInfo(req, res, next) {
try {
let body = req.body;
body.companyInfoImgs = (body.companyInfoImgs || []).map(o => {return o && o._id || o});
body.addressInfo = body.addressInfo || [];
let newAdr = [];
for (let index = 0; index < body.addressInfo.length; index++) {
const element = body.addressInfo[index];
element.img = element.img && element.img._id || element.img;
newAdr.push(element);
}
body.addressInfo = newAdr;
return await DB.CompanyInfo.findOneAndUpdate({_id: body._id},{body});
} catch (error) {
next(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