users.add and users.createOwner only returns id now

This commit is contained in:
Girish Ramakrishnan
2021-08-10 13:50:52 -07:00
parent 2c13158265
commit 79997d5529
2 changed files with 4 additions and 5 deletions

View File

@@ -55,10 +55,10 @@ async function add(req, res, next) {
const username = 'username' in req.body ? req.body.username : null;
const displayName = req.body.displayName || '';
const [error, user] = await safe(users.add(email, { username, password, displayName, invitor: req.user, role: req.body.role || users.ROLE_USER }, auditSource.fromRequest(req)));
const [error, id] = await safe(users.add(email, { username, password, displayName, invitor: req.user, role: req.body.role || users.ROLE_USER }, auditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(201, users.removePrivateFields(user)));
next(new HttpSuccess(201, { id }));
}
async function update(req, res, next) {