mirror of
https://github.com/Paris-est-Ludique/ForceOrange.git
synced 2025-09-11 14:36:29 +02:00
🐛 fixing profile data and some QA issues
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { object, string, type InferType } from 'yup'
|
||||
import type { Database } from '@pel/supabase/types'
|
||||
import type { FormSubmitEvent } from '#ui/types'
|
||||
import { lowerString } from '~/utils/commons';
|
||||
|
||||
definePageMeta({
|
||||
name: 'EmailUpdateForm',
|
||||
@@ -15,7 +16,7 @@ const { inputStyle, formGroupStyle } = useFoStyle()
|
||||
|
||||
const loading = ref(false)
|
||||
const schema = object({
|
||||
email: string().lowercase().trim().email('Il semble que l\'email ne soit pas bon').required('Champ obligatoire'),
|
||||
email: string().lowercase().trim().email('Il semble que l\'email ne soit pas bon').max(500, 'hmmmm c\'est un peu beaucoup là non ?').required('Champ obligatoire'),
|
||||
})
|
||||
|
||||
type Schema = InferType<typeof schema>
|
||||
@@ -29,7 +30,7 @@ async function onSave(event: FormSubmitEvent<Schema>) {
|
||||
|
||||
const formSubmit = event.data
|
||||
const { data, error } = await auth.updateUser({
|
||||
email: formSubmit.email,
|
||||
email: lowerString(formSubmit.email),
|
||||
})
|
||||
|
||||
if (error) {
|
||||
|
@@ -17,7 +17,7 @@ const { inputStyle, formGroupStyle } = useFoStyle()
|
||||
const loading = ref(false)
|
||||
|
||||
const schema = object({
|
||||
password: string().min(6, 'Il faudrait un minimum de 6 charactères').test({
|
||||
password: string().min(6, 'Il faudrait un minimum de 6 charactères').max(500, 'hmmmm c\'est un peu beaucoup là non ?').test({
|
||||
name: 'password',
|
||||
message: 'Le mot de passe n\'est pas assez fort ~~',
|
||||
test: (value) => {
|
||||
|
Reference in New Issue
Block a user