feat(api): group ownership API route, switch client-side to use API route

This commit is contained in:
Julian Lam
2020-12-22 14:26:31 -05:00
parent 98550d61d7
commit 32e36f7b2e
8 changed files with 53 additions and 36 deletions

View File

@@ -79,6 +79,8 @@ async function isInvited(socket, data) {
}
SocketGroups.grant = async (socket, data) => {
sockets.warnDeprecated(socket, 'PUT /api/v3/groups/:slug/ownership/:uid');
await isOwner(socket, data);
await groups.ownership.grant(data.toUid, data.groupName);
logGroupEvent(socket, 'group-owner-grant', {
@@ -88,6 +90,8 @@ SocketGroups.grant = async (socket, data) => {
};
SocketGroups.rescind = async (socket, data) => {
sockets.warnDeprecated(socket, 'DELETE /api/v3/groups/:slug/ownership/:uid');
await isOwner(socket, data);
await groups.ownership.rescind(data.toUid, data.groupName);
logGroupEvent(socket, 'group-owner-rescind', {