Add moderator bots and editable MineGeo usernames
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 3m27s
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 3m27s
This commit is contained in:
@@ -256,10 +256,10 @@ export async function accountApi(
|
||||
{ error: "Earn a username glow before choosing its color" },
|
||||
403,
|
||||
);
|
||||
const profile = required(
|
||||
await admin()
|
||||
const updatedProfile = await admin()
|
||||
.from("profiles")
|
||||
.update({
|
||||
...(body.username !== undefined ? { username: body.username } : {}),
|
||||
...(body.displayName !== undefined
|
||||
? { display_name: body.displayName }
|
||||
: {}),
|
||||
@@ -272,10 +272,11 @@ export async function accountApi(
|
||||
})
|
||||
.eq("id", account.id)
|
||||
.select(
|
||||
"id,display_name,avatar_path,role,name_glow,glow_color,bug_finder,custom_prefix,custom_prefix_icon",
|
||||
"id,username,display_name,avatar_path,role,name_glow,glow_color,bug_finder,custom_prefix,custom_prefix_icon",
|
||||
)
|
||||
.single(),
|
||||
);
|
||||
.single();
|
||||
if (updatedProfile.error?.code === "23505") return json({ error: "That username is already taken." }, 409);
|
||||
const profile = required(updatedProfile);
|
||||
if (
|
||||
body.avatarPath !== undefined &&
|
||||
body.avatarPath !== current.avatar_path
|
||||
|
||||
Reference in New Issue
Block a user