mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-15 23:18:39 +09:00
fix(api): enforce guild bans when approving registrations (#2270)
This commit is contained in:
1 parent
0ca0defd24
commit
6a188a4cdf
3 files changed
+99
-3
No files matched your search
@@ -626,14 +626,14 @@ async function updatePendingRegistrationUser(
|
||||
return;
|
||||
}
|
||||
const traits = new Set(user.traits);
|
||||
traits.delete(REGISTRATION_PENDING_APPROVAL_TRAIT);
|
||||
const wasPendingApproval = traits.delete(REGISTRATION_PENDING_APPROVAL_TRAIT);
|
||||
if (decision === 'reject') {
|
||||
traits.add(REGISTRATION_REJECTED_TRAIT);
|
||||
} else {
|
||||
traits.delete(REGISTRATION_REJECTED_TRAIT);
|
||||
}
|
||||
await userRepository.patchUpsert(user.id, {traits: traits.size > 0 ? traits : null}, user.toRow());
|
||||
if (decision === 'approve') {
|
||||
if (decision === 'approve' && wasPendingApproval) {
|
||||
await ctx.get('singleCommunityService').joinStockCommunity(user.id, ctx.get('requestCache'));
|
||||
}
|
||||
await ctx.get('adminService').auditService.createAuditLog({
|
||||
|
||||
Reference in new issue
Block a user