refactor error handling in profile tab
This commit is contained in:
parent
397622078f
commit
4dde9c4d52
7 changed files with 41 additions and 76 deletions
|
@ -162,7 +162,12 @@ const updateProfileImages = ({ credentials, avatar = null, banner = null, backgr
|
|||
body: form
|
||||
})
|
||||
.then((data) => data.json())
|
||||
.then((data) => parseUser(data))
|
||||
.then((data) => {
|
||||
if (data.error) {
|
||||
throw new Error(data.error)
|
||||
}
|
||||
return parseUser(data)
|
||||
})
|
||||
}
|
||||
|
||||
const updateProfile = ({ credentials, params }) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue