mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 13:03:08 +00:00
Merge remote-tracking branch 'Vespe-r/fix/pronouns_length_limit'
This commit is contained in:
commit
9c5eb62be7
4 files changed
+13
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -187,6 +187,18 @@ router.patch("/", route({ requestBody: "UserProfileModifySchema" }), async (req:
|
||||
}
|
||||
}
|
||||
|
||||
if (body.pronouns) {
|
||||
const { maxPronouns } = Config.get().limits.user;
|
||||
if (body.pronouns.length > maxPronouns) {
|
||||
throw FieldErrors({
|
||||
pronouns: {
|
||||
code: "PRONOUNS_INVALID",
|
||||
message: `Pronouns must be less than ${maxPronouns} in length`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
user.assign(body);
|
||||
await user.save();
|
||||
|
||||
|
||||
@@ -21,4 +21,5 @@ export class UserLimits {
|
||||
maxUsername: number = 32;
|
||||
maxFriends: number = 5000;
|
||||
maxBio: number = 190;
|
||||
maxPronouns: number = 40;
|
||||
}
|
||||
Reference in new issue
Block a user