fix: only send updated fields to API

This commit is contained in:
Simon Emanuelsson
2024-08-23 15:53:48 +02:00
committed by Michael Zetterberg
parent e3b97fcdf9
commit ae751402d6
2 changed files with 124 additions and 21 deletions

View File

@@ -82,16 +82,10 @@ export default function Form({ user }: EditFormProps) {
console.error(issue)
})
}
toast.error(
intl.formatMessage({
id: "An error occured when trying to update profile.",
})
)
toast.error(response.message)
break
case Status.success:
toast.success(
intl.formatMessage({ id: "Successfully updated profile!" })
)
toast.success(response.message)
utils.user.get.invalidate()
router.push(profile[lang])
break