Преглед на файлове

get deep copy bug fix

master
kj1352 преди 4 години
родител
ревизия
4e98f7fb87
променени са 1 файла, в които са добавени 6 реда и са изтрити 5 реда
  1. +6
    -5
      src/user-profile/profile-routes.ts

+ 6
- 5
src/user-profile/profile-routes.ts Целия файл

@@ -33,12 +33,13 @@ userProfileRoutes.get('/deep-copy/', jwtAuthentication, async (request, response
const wordCollection = getDatabaseClient().db(DB_NAME).collection<Word>('words');

const allDeepCategories: any = [];
let allCategories;

const allCategories = await categoryCollection.find({
_id: { $in: user.categories.map(id => new ObjectId(id)) }
}).toArray();
if (allCategories === undefined) {
try {
allCategories = await categoryCollection.find({
_id: { $in: user.categories.map(id => new ObjectId(id)) }
}).toArray();
} catch {
response.status(200);
response.json({
_id: user._id,


Зареждане…
Отказ
Запис