(token: string, init?: boolean)
| 483 | |
| 484 | // Update avatar |
| 485 | const updateAvatar = (token: string, init?: boolean) => { |
| 486 | return Api.updateUser({ avatar: token, init, avatarColor: null }).then((res) => { |
| 487 | const { success, data } = res.data; |
| 488 | if (success) { |
| 489 | Message.success({ |
| 490 | content: t(Strings.avatar_modified_successfully), |
| 491 | }); |
| 492 | dispatch(StoreActions.setUserAvatarColor(null)); |
| 493 | dispatch(StoreActions.setUserAvatar(data)); |
| 494 | dispatch(StoreActions.setReqStatus(true)); |
| 495 | return; |
| 496 | } |
| 497 | }); |
| 498 | }; |
| 499 | |
| 500 | const updateAvatarColor = (avatarColor: number) => { |
| 501 | return Api.updateUser({ |
no test coverage detected