mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix linkedFile.delete
This commit is contained in:
1 file changed
+1
-1
@@ -57,7 +57,7 @@ export class StorageModel {
|
|||||||
const processedIds = [];
|
const processedIds = [];
|
||||||
for (const i of linked || []) {
|
for (const i of linked || []) {
|
||||||
if (processedIds.includes(i.link)) continue;
|
if (processedIds.includes(i.link)) continue;
|
||||||
const current = affected.find((t) => t._id === t.link); // to be deleted
|
const current = affected.find((t) => t._id === i.link); // to be deleted
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
StorageModel.coll.updateOne({ _id: current._id }, { $set: omit(i, ['_id']) }),
|
StorageModel.coll.updateOne({ _id: current._id }, { $set: omit(i, ['_id']) }),
|
||||||
|
|||||||
Reference in new issue
Block a user