浏览代码

deep copy API bug fix

master
kj1352 4 年前
父节点
当前提交
517a6cc701
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      src/user-profile/profile-routes.ts

+ 4
- 1
src/user-profile/profile-routes.ts 查看文件

@@ -38,7 +38,6 @@ userProfileRoutes.get('/deep-copy/', jwtAuthentication, async (request, response
_id: { $in: user.categories.map(id => new ObjectId(id)) } _id: { $in: user.categories.map(id => new ObjectId(id)) }
}).toArray(); }).toArray();



try { try {
for (let i = 0; i < allCategories.length; i += 1) { for (let i = 0; i < allCategories.length; i += 1) {
if (allCategories[i].shelves) { if (allCategories[i].shelves) {
@@ -63,6 +62,10 @@ userProfileRoutes.get('/deep-copy/', jwtAuthentication, async (request, response
...allCategories[i], ...allCategories[i],
shelves, shelves,
}); });
} else {
allDeepCategories.push({
...allCategories[i];
})
} }
} }
} catch { } catch {


正在加载...
取消
保存