Parcourir la source

Returning IDs for category and shelf on addition of new record

master
kj1352 il y a 4 ans
Parent
révision
1eafa8af23
2 fichiers modifiés avec 4 ajouts et 2 suppressions
  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 Voir le fichier

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


+ 2
- 1
src/user-profile/shelf-routes.ts Voir le fichier

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

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


Chargement…
Annuler
Enregistrer