mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
don't remove old user custom avatar when old custom avatar type is empty
This commit is contained in:
+1
-1
@@ -563,7 +563,7 @@ func (a *UsersApi) UserUpdateAvatarHandler(c *core.Context) (any, *errs.Error) {
|
|||||||
return nil, errs.Or(err, errs.ErrOperationFailed)
|
return nil, errs.Or(err, errs.ErrOperationFailed)
|
||||||
}
|
}
|
||||||
|
|
||||||
if fileExtension != user.CustomAvatarType {
|
if fileExtension != user.CustomAvatarType && user.CustomAvatarType != "" {
|
||||||
err = storage.Container.DeleteAvatar(user.Uid, user.CustomAvatarType)
|
err = storage.Container.DeleteAvatar(user.Uid, user.CustomAvatarType)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user