明树Git Lab

Commit 33f8984c authored by zfp1's avatar zfp1

update

parent 0dc6afe3
...@@ -261,12 +261,12 @@ async function addMat(req, res, next) { ...@@ -261,12 +261,12 @@ async function addMat(req, res, next) {
...req.body, ...req.body,
creator, creator,
} }
// if (req.body.name) { if (req.body.name) {
// let check = await DB.AgrMat.findOne({ name: req.body.name }); let check = await DB.AgrMat.findOne({ name: req.body.name });
// if (check) { if (check) {
// return res.sendError(errorMessage.nameDuplicated); return res.sendError(errorMessage.nameDuplicated);
// } }
// } }
let ret = await DB.AgrMat.findOneAndUpdate({ name: info.name }, info, { upsert: true, returnOriginal: false }); let ret = await DB.AgrMat.findOneAndUpdate({ name: info.name }, info, { upsert: true, returnOriginal: false });
res.sendData(ret); res.sendData(ret);
} catch (error) { } 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