refactor: use updated SelectTag component that accepts options array instead of string array to work

This commit is contained in:
Abhinav Raut
2025-03-21 23:24:06 +05:30
parent 7e16cc1a74
commit 28a6a3d246
6 changed files with 298 additions and 29 deletions

View File

@@ -34,7 +34,7 @@
<FormItem v-auto-animate>
<FormLabel>Teams</FormLabel>
<FormControl>
<SelectTag :items="teamNames" placeholder="Select teams" v-model="componentField.modelValue" @update:modelValue="handleChange"/>
<SelectTag :items="teamOptions" placeholder="Select teams" v-model="componentField.modelValue" @update:modelValue="handleChange"/>
</FormControl>
<FormMessage />
</FormItem>
@@ -44,7 +44,7 @@
<FormItem v-auto-animate>
<FormLabel>Roles</FormLabel>
<FormControl>
<SelectTag :items="roleNames" placeholder="Select roles" v-model="componentField.modelValue" @update:modelValue="handleChange"/>
<SelectTag :items="roleOptions" placeholder="Select roles" v-model="componentField.modelValue" @update:modelValue="handleChange"/>
</FormControl>
<FormMessage />
</FormItem>
@@ -140,8 +140,8 @@ onMounted(async () => {
}
})
const teamNames = computed(() => teams.value.map((team) => team.name))
const roleNames = computed(() => roles.value.map((role) => role.name))
const teamOptions = computed(() => teams.value.map((team) => ({ label: team.name, value: team.name })))
const roleOptions = computed(() => roles.value.map((role) => ({ label: role.name, value: role.name })))
const form = useForm({
validationSchema: toTypedSchema(userFormSchema)