明树Git Lab

Commit b22f7044 authored by zfp1's avatar zfp1

update

parent 9206edf6
......@@ -5,7 +5,8 @@
async function findCompInfo(req, res, next) {
try {
return await DB.CompanyInfo.findOne({}).populate({path: "companyInfoImgs"}).populate({path: "addressInfo.img"}).lean().exec();
let ret = await DB.CompanyInfo.findOne({}).populate({path: "companyInfoImgs"}).populate({path: "addressInfo.img"}).lean().exec();
return res.sendData(ret);
} catch (error) {
next(error);
}
......@@ -23,7 +24,9 @@ async function updateCompInfo(req, res, next) {
newAdr.push(element);
}
body.addressInfo = newAdr;
return await DB.CompanyInfo.findOneAndUpdate({_id: body._id},{body});
let ret = await DB.CompanyInfo.findOneAndUpdate({_id: body._id},{body});
return res.sendData(ret);
} 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