feat: #11420, add new GET routes to retrieve pending and invited members of a group, plus accept/reject pending

This commit is contained in:
Julian Lam
2023-03-30 15:46:40 -04:00
parent cc1c493bbf
commit 0788fb5118
9 changed files with 98 additions and 31 deletions

View File

@@ -47,3 +47,23 @@ Groups.rescind = async (req, res) => {
await api.groups.rescind(req, req.params);
helpers.formatApiResponse(200, res);
};
Groups.getPending = async (req, res) => {
const pending = await api.groups.getPending(req, req.params);
helpers.formatApiResponse(200, res, { pending });
};
Groups.accept = async (req, res) => {
await api.groups.accept(req, req.params);
helpers.formatApiResponse(200, res);
};
Groups.reject = async (req, res) => {
await api.groups.reject(req, req.params);
helpers.formatApiResponse(200, res);
};
Groups.getInvites = async (req, res) => {
const invites = await api.groups.getInvites(req, req.params);
helpers.formatApiResponse(200, res, { invites });
};