mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Frontend validations for regex
This commit is contained in:
parent
4fbabc879f
commit
e8f47cb004
@ -5,6 +5,7 @@ export default function UniqueSlugForm({ translate, apollo, currentUser }) {
|
||||
return {
|
||||
formSchema: {
|
||||
slug: [
|
||||
{type: "string", required: true, pattern: /^[a-z0-9_-]+$/, message: translate('settings.validation.slug.regex') },
|
||||
{
|
||||
asyncValidator(rule, value, callback) {
|
||||
debounce(() => {
|
||||
|
||||
@ -159,6 +159,7 @@
|
||||
},
|
||||
"validation": {
|
||||
"slug": {
|
||||
"regex": "Es sind nur Kleinbuchstaben, Zahlen, Unterstriche oder Bindestriche erlaubt.",
|
||||
"alreadyTaken": "Dieser Benutzername ist schon vergeben."
|
||||
}
|
||||
},
|
||||
|
||||
@ -160,6 +160,7 @@
|
||||
},
|
||||
"validation": {
|
||||
"slug": {
|
||||
"regex": "Allowed characters are only lowercase letters, numbers, underscores and hyphens.",
|
||||
"alreadyTaken": "This user name is already taken."
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user