|
@@ -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 { |
|
|