refactor(api): deprecated groups update socket in favour of API lib

This commit is contained in:
Julian Lam
2020-12-21 22:05:00 -05:00
parent e640a41a78
commit 1cd2689cf6
8 changed files with 54 additions and 34 deletions

View File

@@ -33,6 +33,16 @@ groupsAPI.create = async function (caller, data) {
return groupData;
};
groupsAPI.update = async function (caller, data) {
const groupName = await groups.getGroupNameByGroupSlug(data.slug);
await isOwner(caller, groupName);
delete data.slug;
await groups.update(groupName, data);
return await groups.getGroupData(data.name || groupName);
};
groupsAPI.delete = async function (caller, data) {
const groupName = await groups.getGroupNameByGroupSlug(data.slug);
await isOwner(caller, groupName);