🛠️ Minor changes in frontend (#715)

This commit is contained in:
Alejandra
2024-03-13 22:59:28 +01:00
committed by GitHub
parent 10ef99cb68
commit 21232c0f9f
9 changed files with 13 additions and 12 deletions

View File

@@ -44,7 +44,7 @@ const ChangePassword: React.FC = () => {
reset()
},
onError: (err: ApiError) => {
const errDetail = err.body.detail
const errDetail = err.body?.detail
showToast('Something went wrong.', `${errDetail}`, 'error')
},
})

View File

@@ -46,7 +46,7 @@ const DeleteConfirmation: React.FC<DeleteProps> = ({ isOpen, onClose }) => {
onClose()
},
onError: (err: ApiError) => {
const errDetail = err.body.detail
const errDetail = err.body?.detail
showToast('Something went wrong.', `${errDetail}`, 'error')
},
onSettled: () => {

View File

@@ -53,7 +53,7 @@ const UserInformation: React.FC = () => {
showToast('Success!', 'User updated successfully.', 'success')
},
onError: (err: ApiError) => {
const errDetail = err.body.detail
const errDetail = err.body?.detail
showToast('Something went wrong.', `${errDetail}`, 'error')
},
onSettled: () => {
@@ -118,7 +118,7 @@ const UserInformation: React.FC = () => {
/>
) : (
<Text size="md" py={2}>
{currentUser!.email}
{currentUser?.email}
</Text>
)}
{errors.email && (