Reduce min name length

This commit is contained in:
2025-09-14 17:57:24 +02:00
parent 5c66430cb4
commit 527c9b7428
4 changed files with 29 additions and 4 deletions
+19 -1
View File
@@ -2,6 +2,7 @@
import { parseError } from '#shared/utils/error';
const { t } = useI18n();
const validation = useValidation();
const emits = defineEmits<{
update: [];
}>();
@@ -47,6 +48,7 @@ async function submit() {
}
pending.value = false;
}
// TODO: translate
</script>
<template>
@@ -56,13 +58,29 @@ async function submit() {
<VaModal v-model="isOpen" close-button hide-default-actions>
<h3 class="text-3xl">Create a new team</h3>
<div class="mt-4 flex flex-col gap-4">
<VaInput v-model="data.name" label="Name" placeholder="My cool team" />
<VaInput
v-model="data.name"
label="Name"
placeholder="My cool team"
min-length="3"
max-length="256"
counter
:rules="[
validation.required('Name'),
validation.max('Name', 256),
validation.min('Name', 3)
]"
required
/>
<VaTextarea
v-model="data.description"
max-rows="4"
min-rows="2"
label="Description"
placeholder="The best team!"
max-length="256"
counter
:rules="[validation.maxOptional('Description', 256)]"
/>
<p>An invite code will be generated automatically.</p>
<VaAlert v-if="error" color="danger">{{ t(error) }}</VaAlert>