This website works better with JavaScript.
Home
Explore
Help
Sign In
kj
/
anamnesis-backend
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
Returning IDs for category and shelf on addition of new record
master
kj1352
4 years ago
parent
0ed1477ab7
commit
1eafa8af23
2 changed files
with
4 additions
and
2 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+2
-1
src/user-profile/category-routes.ts
+2
-1
src/user-profile/shelf-routes.ts
+ 2
- 1
src/user-profile/category-routes.ts
View File
@@ -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
View File
@@ -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);
}
Write
Preview
Loading…
Cancel
Save