Skip to content

Commit

Permalink
fix: use api routes for group accept/reject
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Apr 6, 2023
1 parent be32325 commit 34d99c1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions public/src/client/groups/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,16 @@ define('forum/groups/details', [
api.del('/groups/' + ajaxify.data.group.slug + '/membership/' + (uid || app.user.uid), undefined).then(() => ajaxify.refresh()).catch(alerts.error);
break;

// TODO (14/10/2020): rewrite these to use api module and merge with above 2 case blocks
case 'accept': // intentional fall-throughs!
case 'accept':
api.put(`/groups/${ajaxify.data.group.slug}/pending/${uid}`).then(() => ajaxify.refresh()).catch(alerts.error);
break;

case 'reject':
case 'issueInvite':
api.del(`/groups/${ajaxify.data.group.slug}/pending/${uid}`).then(() => ajaxify.refresh()).catch(alerts.error);
break;

// TODO (14/10/2020): rewrite these to use api module and merge with above 2 case blocks
case 'issueInvite': // intentional fall-throughs!
case 'rescindInvite':
case 'acceptInvite':
case 'rejectInvite':
Expand Down

0 comments on commit 34d99c1

Please sign in to comment.