forked from administration/panel
chore: unset display name
parent
1d8bc5f301
commit
e1fd192f8b
|
@ -84,7 +84,7 @@ export function UserActions({ user, bot }: { user: User; bot?: Bot }) {
|
|||
const badges =
|
||||
(decodeTime(user._id) < 1629638578431 ? 256 : 0) |
|
||||
((userDraft.badges ?? 0) ^ badge);
|
||||
const result = await updateUserBadges(user._id, badges);
|
||||
await updateUserBadges(user._id, badges);
|
||||
setUserDraft((user) => ({ ...user!, badges }));
|
||||
toast({
|
||||
title: "Updated user badges",
|
||||
|
|
|
@ -473,8 +473,6 @@ export async function wipeUserProfile(
|
|||
) {
|
||||
await checkPermission("users/action/wipe-profile", userId);
|
||||
|
||||
const newDisplayName = (await fetchUserById(userId))?.username || "--";
|
||||
|
||||
await mongo()
|
||||
.db("revolt")
|
||||
.collection<User>("users")
|
||||
|
@ -488,14 +486,8 @@ export async function wipeUserProfile(
|
|||
...(fields.bio ? { "profile.content": 1 } : {}),
|
||||
...(fields.status ? { "status.text": 1 } : {}),
|
||||
...(fields.avatar ? { avatar: 1 } : {}),
|
||||
...(fields.displayName ? { display_name: 1 } : {}),
|
||||
},
|
||||
...(fields.displayName
|
||||
? {
|
||||
$set: {
|
||||
display_name: newDisplayName,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue