mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
服务状态(/status)
This commit is contained in:
1 parent
b2989cb9ea
commit
216a4a91e4
19 files changed
+322
-136
No files matched your search
@@ -23,6 +23,7 @@ async function add(
|
||||
) {
|
||||
const _id = new ObjectID();
|
||||
const doc = {
|
||||
_id,
|
||||
content,
|
||||
owner,
|
||||
domainId,
|
||||
@@ -53,8 +54,10 @@ async function set(domainId, docType, docId, args) {
|
||||
}
|
||||
|
||||
function deleteOne(domainId, docType, docId) {
|
||||
// TODO(twd2): delete status?
|
||||
return coll.deleteOne({ domainId, docType, docId });
|
||||
return Promise.all([
|
||||
coll.deleteMany({ domainId, docType, docId }),
|
||||
coll.deleteOne({ domainId, docType, docId }),
|
||||
]);
|
||||
}
|
||||
|
||||
function deleteMulti(domainId, docType, args = {}) {
|
||||
@@ -134,9 +137,7 @@ async function getSub(domainId, docType, docId, key, subId) {
|
||||
});
|
||||
if (!doc) return [null, null];
|
||||
for (const sdoc of doc[key] || []) {
|
||||
if (sdoc._id === subId) {
|
||||
return [doc, sdoc];
|
||||
}
|
||||
if (sdoc._id === subId) return [doc, sdoc];
|
||||
}
|
||||
return [doc, null];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user