LinkinStars commented on code in PR #1335:
URL: https://github.com/apache/answer/pull/1335#discussion_r2096796582


##########
ui/src/pages/Users/Settings/Profile/index.tsx:
##########
@@ -241,10 +241,7 @@ const Index: React.FC = () => {
 
     modifyUserInfo(params)
       .then(() => {
-        update({
-          ...user,
-          ...params,
-        });
+        getLoggedUserInfo().then(update);

Review Comment:
   @DanielAuerX Thanks for the feedback, it made us realise that there is a bit 
of an issue with the backend here for errors as well. Maybe just adjust the 
error handling on the backend. 
   
   
https://github.com/apache/answer/blob/3f1ed50f6776452c11b6ffdbdc767cd1887d629b/internal/service/uploader/upload.go#L152
   
   ```go
   // There should be a 404 error here
   return "", errors.NotFound(reason.UnknownError).WithError(err)
   ```
   
   
https://github.com/apache/answer/blob/3f1ed50f6776452c11b6ffdbdc767cd1887d629b/internal/base/middleware/avatar.go#L62-L68
   
   ```go
   filePath, err = am.uploaderService.AvatarThumbFile(ctx, filename, size)
   if err != nil {
        log.Error(err)
        ctx.AbortWithStatus(http.StatusNotFound)
        // This should not be continued here, but should be returned directly, 
because the file no longer exists.
        return
   }
   ```
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to