From 34d99c15afd9441ab022b8feb203084a61e338b7 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 31 Mar 2023 14:47:01 -0400 Subject: [PATCH] fix: use api routes for group accept/reject --- public/src/client/groups/details.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/public/src/client/groups/details.js b/public/src/client/groups/details.js index 3b553bbb8f..9202b56935 100644 --- a/public/src/client/groups/details.js +++ b/public/src/client/groups/details.js @@ -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':