aicam commented on code in PR #4065:
URL: https://github.com/apache/texera/pull/4065#discussion_r2534621437


##########
frontend/src/app/dashboard/component/admin/user/admin-user.component.ts:
##########
@@ -126,12 +126,33 @@ export class AdminUserComponent implements OnInit {
     }
 
     const currentUid = this.editUid;
+    const localUpdated: User = {

Review Comment:
   Add a comment to explain why do we have this block of code, future developer 
may not understand why we have this extra step



##########
frontend/src/app/dashboard/component/admin/user/admin-user.component.ts:
##########
@@ -126,12 +126,33 @@ export class AdminUserComponent implements OnInit {
     }
 
     const currentUid = this.editUid;
+    const localUpdated: User = {
+      ...originalUser,
+      name: this.editName,
+      email: this.editEmail,
+      comment: this.editComment,
+      role: this.editRole,
+    };
     this.stopEdit();
     this.adminUserService
       .updateUser(currentUid, this.editName, this.editEmail, this.editRole, 
this.editComment)
       .pipe(untilDestroyed(this))
       .subscribe({
-        next: () => this.ngOnInit(),
+        next: () => {

Review Comment:
   Define a generic utility function to replace a specific element of an array 
in a `util` file and use it here 



-- 
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