Skip to content

Commit dde50e6

Browse files
authored
refactor: only print subset of user properties. (#1804)
* refactor: only print subset of user properties. * chore: Auto-format JavaScript files with Prettier
1 parent 894510d commit dde50e6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

core/database/foxx/api/user_router.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ router
316316
.get("/update", function (req, res) {
317317
let client = null;
318318
let result = null;
319+
let extra_log_info = null;
319320
try {
320321
g_db._executeTransaction({
321322
collections: {
@@ -391,6 +392,15 @@ router
391392
delete user.new.refresh;
392393

393394
result = [user.new];
395+
396+
const { is_admin, max_coll, max_proj, max_sav_qry } = user.new;
397+
398+
extra_log_info = {
399+
is_admin,
400+
max_coll,
401+
max_proj,
402+
max_sav_qry,
403+
};
394404
},
395405
});
396406
res.send(result);
@@ -401,7 +411,7 @@ router
401411
routePath: basePath + "/update",
402412
status: "Success",
403413
description: "Update user information",
404-
extra: result,
414+
extra: extra_log_info,
405415
});
406416
} catch (e) {
407417
logger.logRequestFailure({
@@ -411,7 +421,7 @@ router
411421
routePath: basePath + "/update",
412422
status: "Failure",
413423
description: "Update user information",
414-
extra: result,
424+
extra: extra_log_info,
415425
error: e,
416426
});
417427
g_lib.handleException(e, res);

0 commit comments

Comments
 (0)