refactor: move groups.leave, fix some tests

This commit is contained in:
Barış Soner Uşaklı
2020-10-15 17:29:38 -04:00
parent bbbd9fee85
commit e367c5403e
7 changed files with 106 additions and 132 deletions

View File

@@ -12,6 +12,9 @@ const events = require('../events');
const usersAPI = module.exports;
usersAPI.create = async function (caller, data) {
if (!data) {
throw new Error('[[error:invalid-data]]');
}
const uid = await user.create(data);
return await user.getUserData(uid);
};