Skip to content

Commit

Permalink
fix(fe): fix save button bug (#2163)
Browse files Browse the repository at this point in the history
  • Loading branch information
jihorobert authored Oct 13, 2024
1 parent 76e4ee2 commit 97b8b66
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions apps/frontend/app/(main)/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,23 +198,21 @@ export default function Page() {
}

const onSubmitClick = () => {
return () => {
// submit 되기위해, watch로 확인되는 값이 default값과 같으면 setValue를 통해서 defaultProfileValues로 변경
if (realName === '') {
setValue('realName', defaultProfileValues.userProfile?.realName)
}
if (majorValue === defaultProfileValues.major) {
setMajorValue(defaultProfileValues.major)
}
if (currentPassword === '') {
setValue('currentPassword', 'tmppassword1')
}
if (newPassword === '') {
setValue('newPassword', 'tmppassword1')
}
if (confirmPassword === '') {
setValue('confirmPassword', 'tmppassword1')
}
// submit 되기위해, watch로 확인되는 값이 default값과 같으면 setValue를 통해서 defaultProfileValues로 변경
if (realName === '') {
setValue('realName', defaultProfileValues.userProfile?.realName)
}
if (majorValue === defaultProfileValues.major) {
setMajorValue(defaultProfileValues.major)
}
if (currentPassword === '') {
setValue('currentPassword', 'tmppassword1')
}
if (newPassword === '') {
setValue('newPassword', 'tmppassword1')
}
if (confirmPassword === '') {
setValue('confirmPassword', 'tmppassword1')
}
}

Expand Down

0 comments on commit 97b8b66

Please sign in to comment.