优化结构

This commit is contained in:
undefined committed 2020-04-30 18:07:35 +08:00
1 parent 75ebc1a746
commit 2554cf660a
34 files changed
+401 -150

No files matched your search

+2 -1
View File
@@ -65,7 +65,7 @@ function editReply(drid, content) {
async function delReply(drid) {
const drdoc = await getReply(drid);
if (!drdoc) throw new DocumentNotFoundError(drid);
return await Promise.all([
return await Promise.all([ // eslint-disable-line no-return-await
collReply.deleteOne({ _id: drid }),
coll.updateOne({ _id: drdoc.did }, { $inc: { nReply: -1 } }),
]);
@@ -112,6 +112,7 @@ async function editTailReply(drid, drrid, content) {
break;
}
}
// eslint-disable-next-line no-return-await
return await collReply.findOneAndUpdate({ _id: drdoc._id }, { $set: { reply } });
}