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

Returning IDs for category and shelf on addition of new record

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

+ 2
- 1
src/user-profile/category-routes.ts Целия файл

@@ -71,7 +71,8 @@ categoryRoutes.post('/add/', jwtAuthentication, async (request, response) => {
} }
}); });
response.sendStatus(200);
response.send(200);
response.send(newCategory.insertedId.toHexString());
} catch(e) { } catch(e) {
response.sendStatus(500); response.sendStatus(500);
return; return;


+ 2
- 1
src/user-profile/shelf-routes.ts Целия файл

@@ -87,7 +87,8 @@ shelfRoutes.post('/add/', jwtAuthentication, async (request, response) => {
}); });


if (updatedCategory) { if (updatedCategory) {
response.sendStatus(200);
response.status(200);
response.send(newShelf.insertedId);
} else { } else {
response.sendStatus(500); response.sendStatus(500);
} }


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