Merge branch 'master' of ssh://109.122.252.86:2222/front-end/banu-front
Deploy banu-front / deploy (push) Successful in 3m33s
Deploy banu-front / deploy (push) Successful in 3m33s
This commit is contained in:
@@ -97,7 +97,7 @@ const props = defineProps({
|
||||
maxSize: { type: Number, default: 5 * 1024 * 1024 },
|
||||
helperText: {
|
||||
type: String,
|
||||
default: 'سایز تصویر رسمی 3x4 و حجم تصویر بیشتر از 5 مگابایت نباشد.',
|
||||
default: 'سایز تصویر رسمی 3x4 و حجم تصویر بیشتر از ۵ مگابایت نباشد.',
|
||||
},
|
||||
helperIcon: { type: String, default: 'warning' },
|
||||
error: { type: String, default: '' },
|
||||
|
||||
@@ -42,6 +42,7 @@ export const fields = {
|
||||
|
||||
avatar: 'تصویر پروفایل',
|
||||
avatarId: 'تصویر پروفایل',
|
||||
avatarMediaId: 'تصویر پروفایل',
|
||||
image: 'تصویر',
|
||||
|
||||
status: 'وضعیت',
|
||||
|
||||
@@ -276,7 +276,7 @@ const form = ref({
|
||||
provinceId: '',
|
||||
cityId: '',
|
||||
address: '',
|
||||
avatarId: null,
|
||||
avatarMediaId: null,
|
||||
password: '',
|
||||
passwordConfirmation: '',
|
||||
})
|
||||
@@ -322,7 +322,7 @@ watch(
|
||||
provinceId: user?.province?.id || '',
|
||||
cityId: user?.city?.id || '',
|
||||
address: typeof user.address === 'string' ? user.address : user.address?.address || '',
|
||||
avatarId: user.avatarId ?? user.profile?.avatarId ?? null,
|
||||
avatarMediaId: null,
|
||||
}
|
||||
initialNationalCode.value = user.nationalCode || ''
|
||||
if (user.avatarUrl) {
|
||||
@@ -340,7 +340,7 @@ const onAvatarCropped = async (file) => {
|
||||
const response = await uploadMutation.mutateAsync(formData)
|
||||
const payload = response?.data ?? response
|
||||
avatar.value = { url: payload?.url, uploadId: payload?.uploadId, ...payload }
|
||||
form.value.avatarId = payload?.uploadId || payload?.id
|
||||
form.value.avatarMediaId = payload?.uploadId || payload?.id
|
||||
} catch {
|
||||
/* error handled by global handler */
|
||||
}
|
||||
@@ -370,7 +370,7 @@ const buildUpdatePayload = () => {
|
||||
nationalCode: form.value.nationalCode,
|
||||
phone: form.value.phone,
|
||||
bio: form.value.bio || '',
|
||||
avatarId: form.value.avatarId || null,
|
||||
avatarMediaId: form.value.avatarMediaId || null,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { object, string } from 'yup'
|
||||
import { number, object, string } from 'yup'
|
||||
import { passwordRule } from '@/constants/rules/passwordRule'
|
||||
import { phoneNumberRule } from '@/constants/rules/phoneNumberRule'
|
||||
import { nationalCodeRule } from '@/constants/rules/nationalCodeRule'
|
||||
@@ -20,6 +20,7 @@ const baseUserShape = {
|
||||
provinceId: string().nullable().notRequired(),
|
||||
cityId: string().nullable().notRequired(),
|
||||
address: string().nullable().notRequired(),
|
||||
avatarMediaId: number().nullable().notRequired(),
|
||||
}
|
||||
|
||||
export const userAddSchema = object().shape({
|
||||
|
||||
Reference in New Issue
Block a user