Este site funciona melhor com JavaScript.
Página inicial
Explorar
Ajuda
Acessar
kj
/
anamnesis-backend
Observar
1
Favorito
0
Fork
0
Código
Issues
0
Pull requests
0
Versões
0
Wiki
Atividade
Ver código fonte
Returning IDs for category and shelf on addition of new record
master
kj1352
4 anos atrás
pai
0ed1477ab7
commit
1eafa8af23
2 arquivos alterados
com
4 adições
e
2 exclusões
Visão dividida
Opções de diferenças
Mostrar estatísticas
Baixar arquivo de patch
Baixar arquivo de diferenças
+2
-1
src/user-profile/category-routes.ts
+2
-1
src/user-profile/shelf-routes.ts
+ 2
- 1
src/user-profile/category-routes.ts
Ver arquivo
@@ -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
Ver arquivo
@@ -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);
}
Escrever
Pré-visualização
Carregando…
Cancelar
Salvar