Fix edge function logging and types

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 19:57:27 +00:00
parent 99ceacfe0c
commit 6fbaf0c606
9 changed files with 175 additions and 62 deletions

View File

@@ -93,11 +93,17 @@ export function ProfileManager() {
setActionLoading(targetUserId);
try {
// Prepare update data
const updateData: any = { banned: ban };
interface ProfileUpdateData {
banned: boolean;
ban_reason?: string | null;
ban_expires_at?: string | null;
}
const updateData: ProfileUpdateData = { banned: ban };
if (ban && banReason) {
updateData.ban_reason = banReason;
updateData.ban_expires_at = banExpiresAt;
updateData.ban_expires_at = banExpiresAt ? banExpiresAt.toISOString() : null;
} else if (!ban) {
// Clear ban data when unbanning
updateData.ban_reason = null;