mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-14 10:09:09 +03:00
fix: allow 0 length about-mes
This commit is contained in:
@@ -34,7 +34,7 @@ function AboutMeCard({ reqUser }: Props) {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ about: content }),
|
||||
body: JSON.stringify({ about: content.length === 0 ? null : content }),
|
||||
},
|
||||
true,
|
||||
true
|
||||
|
||||
@@ -336,6 +336,7 @@ function SocialMediaForm({ reqUser }: { reqUser: PublicUserDocument }) {
|
||||
},
|
||||
onSubmit: async (values) => {
|
||||
const valuesClone: Record<string, string | null> = {};
|
||||
|
||||
for (const v in values) {
|
||||
const vx = v as keyof typeof values;
|
||||
valuesClone[vx] = values[vx] || null;
|
||||
|
||||
@@ -986,7 +986,7 @@ const PRE_SCHEMAS = {
|
||||
twitch: "*?string",
|
||||
},
|
||||
joinDate: p.isPositiveInteger,
|
||||
about: p.isBoundedString(0, 4000),
|
||||
about: p.isBoundedString(0, 2000),
|
||||
status: p.nullable(p.isBoundedString(3, 140)),
|
||||
customPfpLocation: "?string",
|
||||
customBannerLocation: "?string",
|
||||
|
||||
@@ -77,7 +77,7 @@ router.patch(
|
||||
"/",
|
||||
RequireSelfRequestFromUser,
|
||||
prValidate({
|
||||
about: p.optional(p.isBoundedString(3, 2000)),
|
||||
about: p.optional(p.isBoundedString(0, 2000)),
|
||||
status: optNullFluffStrField,
|
||||
discord: optNullFluffStrField,
|
||||
twitter: optNullFluffStrField,
|
||||
|
||||
Reference in New Issue
Block a user