Skip to content

Commit

Permalink
Refactor user-service.js to exclude password field in User.find() query
Browse files Browse the repository at this point in the history
  • Loading branch information
UO285267 committed Apr 8, 2024
1 parent f9097b4 commit 387a236
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion users/userservice/user-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ app.post('/adduser', async (req, res) => {

app.get('/users', async (req, res) => {
try {
const users = await User.find();
const users = await User.find({}, { password: 0 });
res.status(200).json(users);
} catch (error) {
// Manejo de errores
Expand Down

0 comments on commit 387a236

Please sign in to comment.