mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 08:25:46 +01:00
refactor(api): deprecated groups update socket in favour of API lib
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user