You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by GitBox <gi...@apache.org> on 2022/11/12 13:02:49 UTC

[GitHub] [incubator-streampark] macksonmu commented on a diff in pull request #2009: [Bug] Clear the teamId when delete the member

macksonmu commented on code in PR #2009:
URL: https://github.com/apache/incubator-streampark/pull/2009#discussion_r1020755977


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java:
##########
@@ -188,6 +188,16 @@ public void setLatestTeam(Long teamId, Long userId) {
         this.baseMapper.updateById(user);
     }
 
+    @Override
+    public void unbindTeam(Long userId, Long teamId) {
+        User user = getById(userId);
+        AssertUtils.checkArgument(user != null);

Review Comment:
   hi, fan rui, thank you very much for the hard work, when the user is deleted first, then an exception will be thrown when the member is deleted. Is it possible to add a judgment, that is, returns when user is null.
   
   ```
   if (user == null || !teamId.equals(user.getTeamId())) {
        return;
   }
   ```



##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java:
##########
@@ -188,6 +188,16 @@ public void setLatestTeam(Long teamId, Long userId) {
         this.baseMapper.updateById(user);
     }
 
+    @Override
+    public void unbindTeam(Long userId, Long teamId) {
+        User user = getById(userId);
+        AssertUtils.checkArgument(user != null);

Review Comment:
   When deleting a user, the member dependency is not judged



##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java:
##########
@@ -188,6 +188,16 @@ public void setLatestTeam(Long teamId, Long userId) {
         this.baseMapper.updateById(user);
     }
 
+    @Override
+    public void unbindTeam(Long userId, Long teamId) {
+        User user = getById(userId);
+        AssertUtils.checkArgument(user != null);

Review Comment:
   Is it possible that when a person leaves, I may delete this user directly



-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org