Client - display message on image upload error - fix #59

This commit is contained in:
Sam
2021-01-10 12:15:54 +01:00
parent 5c04db6c08
commit 766423409c
6 changed files with 11 additions and 10 deletions

View File

@ -131,9 +131,10 @@ export const uploadPicture = event => dispatch => {
if (ret.status === 'success') {
return dispatch(getProfile())
}
const msg = ret.message.match(/file size exceeds/g)
? 'Error during picture update, file size exceeds max size.'
: ret.message
const msg =
ret.status === 413
? 'Error during picture update, file size exceeds max size.'
: ret.message
return dispatch(PictureError(msg))
})
.catch(error => {