users.add and users.createOwner only returns id now
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user