mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-19 05:55:34 +09:00
refactor(api): emit moderation events and apply account actions (#3031)
This commit is contained in:
1 parent
c488906131
commit
364084c819
385 files changed
+8994
-22221
No files matched your search
@@ -20,6 +20,7 @@ export async function mapUserToAdminResponse(
|
||||
const canViewEmail = !acls || hasAcl(acls, AdminACLs.USER_VIEW_EMAIL);
|
||||
const canViewDob = !acls || hasAcl(acls, AdminACLs.USER_VIEW_DOB);
|
||||
const canViewIp = !acls || hasAcl(acls, AdminACLs.USER_VIEW_IP);
|
||||
const canViewAuditLog = !acls || hasAcl(acls, AdminACLs.AUDIT_LOG_VIEW);
|
||||
const lastActiveIpReverse =
|
||||
canViewIp && user.lastActiveIp ? await getIpAddressReverse(user.lastActiveIp, cacheService) : null;
|
||||
let lastActiveLocation: string | null = null;
|
||||
@@ -65,6 +66,9 @@ export async function mapUserToAdminResponse(
|
||||
pending_bulk_message_deletion_at: user.pendingBulkMessageDeletionAt?.toISOString() ?? null,
|
||||
deletion_reason_code: user.deletionReasonCode,
|
||||
deletion_public_reason: user.deletionPublicReason,
|
||||
deletion_audit_log_reason: canViewAuditLog ? user.deletionAuditLogReason : null,
|
||||
deletion_scheduled_by: user.deletionScheduledBy?.toString() ?? null,
|
||||
deletion_scheduled_at: user.deletionScheduledAt?.toISOString() ?? null,
|
||||
acls: user.acls ? Array.from(user.acls) : [],
|
||||
traits: Array.from(user.traits).sort(),
|
||||
has_totp: user.totpSecret !== null,
|
||||
|
||||
Reference in new issue
Block a user