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