mirror of
https://github.com/ThisIsBenny/wishlist-app.git
synced 2025-04-19 23:37:41 +00:00
regex for url slug text added
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
parent
9f63089261
commit
43f389c29b
5 changed files with 24 additions and 19 deletions
|
@ -84,9 +84,9 @@ const schema = object().shape(
|
|||
300,
|
||||
t('components.form-wishlist.description.error-max')
|
||||
),
|
||||
slugUrlText: string().required(
|
||||
t('components.form-wishlist.slug-text.error-requried')
|
||||
),
|
||||
slugUrlText: string()
|
||||
.required(t('components.form-wishlist.slug-text.error-requried'))
|
||||
.matches(/^[\w-]+$/, t('components.form-wishlist.slug-text.error-regex')),
|
||||
imageSrc: string().when('imageFile', {
|
||||
is: (imageFile: string) => !imageFile || imageFile.length === 0,
|
||||
then: string().required(
|
||||
|
|
|
@ -51,11 +51,12 @@ const props = defineProps({
|
|||
default: false,
|
||||
},
|
||||
})
|
||||
const { value: inputValue, errorMessage, handleBlur, handleChange } = useField(
|
||||
props.name,
|
||||
undefined,
|
||||
{
|
||||
const {
|
||||
value: inputValue,
|
||||
errorMessage,
|
||||
handleBlur,
|
||||
handleChange,
|
||||
} = useField(props.name, undefined, {
|
||||
initialValue: props.value,
|
||||
}
|
||||
)
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -55,11 +55,12 @@ const props = defineProps({
|
|||
default: false,
|
||||
},
|
||||
})
|
||||
const { value: inputValue, errorMessage, handleBlur, handleChange } = useField(
|
||||
props.name,
|
||||
undefined,
|
||||
{
|
||||
const {
|
||||
value: inputValue,
|
||||
errorMessage,
|
||||
handleBlur,
|
||||
handleChange,
|
||||
} = useField(props.name, undefined, {
|
||||
initialValue: props.value,
|
||||
}
|
||||
)
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -136,7 +136,8 @@
|
|||
},
|
||||
"slug-text": {
|
||||
"label": "URL Slug-Text",
|
||||
"error-requried": "URL Slug-Text wird benötigt."
|
||||
"error-requried": "URL Slug-Text wird benötigt.",
|
||||
"error-regex": "Unngültige URL Slug-Text."
|
||||
},
|
||||
"image-src": {
|
||||
"label": "Bild-URL",
|
||||
|
|
|
@ -135,7 +135,9 @@
|
|||
"error-max": "The max. length is 300 chars."
|
||||
},
|
||||
"slug-text": {
|
||||
"label": "URL Slug-Text"
|
||||
"label": "URL Slug-Text",
|
||||
"error-requried": "URL Slug-Text is required.",
|
||||
"error-regex": "Invalid URL Slug-Text."
|
||||
},
|
||||
"image-src": {
|
||||
"label": "Image-URL",
|
||||
|
|
Loading…
Add table
Reference in a new issue