mirror of
https://github.com/YunoHost/yunohost-portal.git
synced 2024-09-03 20:06:23 +02:00
edit: display primary mail adress
This commit is contained in:
parent
8e177e6907
commit
33a9028da9
2 changed files with 9 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
|||
import { useForm } from 'vee-validate'
|
||||
import { toTypedSchema } from '@vee-validate/yup'
|
||||
import * as yup from 'yup'
|
||||
import { pick } from '@/utils/common'
|
||||
import { exclude, pick } from '@/utils/common'
|
||||
import type { User } from '@/composables/states'
|
||||
import type { Feedback } from '@/composables/form'
|
||||
|
||||
|
@ -16,12 +16,13 @@ const { handleSubmit, setFieldError, resetForm, meta } = useForm({
|
|||
validationSchema: toTypedSchema(
|
||||
yup.object({
|
||||
fullname: yup.string().required().min(2),
|
||||
mail: yup.string(),
|
||||
mailalias: yup.array().of(yup.string().email().required()).required(),
|
||||
mailforward: yup.array().of(yup.string().email().required()).required(),
|
||||
}),
|
||||
),
|
||||
initialValues: {
|
||||
...pick(user.value, 'fullname', 'mailalias', 'mailforward'),
|
||||
...pick(user.value, 'fullname', 'mail', 'mailalias', 'mailforward'),
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -43,7 +44,7 @@ const onSubmit = handleSubmit(async (form) => {
|
|||
Pick<User, 'fullname' | 'mailalias' | 'mailforward'>
|
||||
>('/update', {
|
||||
method: 'PUT',
|
||||
body: form,
|
||||
body: exclude(form, 'mail'),
|
||||
})
|
||||
|
||||
if (error.value) {
|
||||
|
@ -91,6 +92,10 @@ const onSubmit = handleSubmit(async (form) => {
|
|||
/>
|
||||
</FormField>
|
||||
|
||||
<FormField name="mail" :label="$t('primary_mail_adress')" class="mb-10">
|
||||
<TextInput name="mail" type="text" class="w-full" disabled />
|
||||
</FormField>
|
||||
|
||||
<TextInputList
|
||||
name="mailalias"
|
||||
type="email"
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
"password": "Password",
|
||||
"possibly_invalid_password": "Password is possibly invalid",
|
||||
"possibly_invalid_username": "Username is possibly invalid",
|
||||
"primary_mail_adress": "Primary mail adress",
|
||||
"remove": "Remove",
|
||||
"save": "Save",
|
||||
"skip_link": {
|
||||
|
|
Loading…
Add table
Reference in a new issue