mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:56:28 +00:00
Update EditProfile.tsx
This commit is contained in:
@@ -36,7 +36,7 @@ const EditProfile: FC<Props> = ({ data }) => {
|
||||
useEffect(() => {
|
||||
if (data) {
|
||||
form.setFieldsValue(data)
|
||||
if (data.birthday) form.setFieldValue('birthday', dayjs(data.birthday).format('YYYY-MM-DD'))
|
||||
if (data.birthday) form.setFieldValue('birthday', dayjs(data.birthday))
|
||||
} else {
|
||||
form.resetFields()
|
||||
}
|
||||
@@ -52,6 +52,8 @@ const EditProfile: FC<Props> = ({ data }) => {
|
||||
try {
|
||||
setIsLoading(true)
|
||||
|
||||
if (payload.birthday) payload['birthday'] = dayjs(payload.birthday).format('YYYY-MM-DD')
|
||||
// if (payload.birthday) payload['birthday'] = dayjs(payload.birthday)
|
||||
await axios.put('/user/profile/update', payload)
|
||||
|
||||
toast.success('Profile changed successfully.')
|
||||
|
||||
Reference in New Issue
Block a user