devabhishekpal commented on code in PR #6411:
URL: https://github.com/apache/ozone/pull/6411#discussion_r1616654107


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -420,6 +423,25 @@ export class Datanodes extends 
React.Component<Record<string, object>, IDatanode
       showDataFetchError(error.toString());
     });
   };
+  
+  removeDatanode= async (selectedRowKeys: any) => {
+    try {
+      await axios.put('/api/v1/datanodes/remove', selectedRowKeys);
+      //Load Datanodes after removal
+      this._loadData();
+      this.setState({

Review Comment:
   Since
   ```
   this.setState({
           loading: false,
           selectedRowKeys: []
   });
   ```
   is being called in both the catch and try statement as the final state 
change, can we instead shift it to a `finally` block?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to