PG1204 commented on code in PR #6446:
URL: https://github.com/apache/texera/pull/6446#discussion_r3598375188


##########
computing-unit-managing-service/src/main/scala/org/apache/texera/service/resource/ComputingUnitAccessResource.scala:
##########
@@ -152,18 +152,22 @@ class ComputingUnitAccessResource {
     }
 
     // TODO: add try except and check how to display error message in the 
frontend
-    val granteeId = userDao.fetchOneByEmail(email).getUid
-    if (granteeId == null) {
+    val grantee = userDao.fetchOneByEmail(email)
+    if (grantee == null) {
       throw new IllegalArgumentException("User with the given email does not 
exist")
     }
+    val granteeId = grantee.getUid

Review Comment:
   done, extracted a private resolveUidByEmail(email) helper and replaced both 
blocks with val granteeId = resolveUidByEmail(email), so grant/revoke stay in 
sync. Kept BadRequestException (400) in the helper rather than 
IllegalArgumentException so it still maps to a proper 4xx. The existing 
unknown-email tests exercise the helper through both endpoints.
   
   addressed in 
https://github.com/apache/texera/commit/91ad863aa74374eb5a280d890fd822cc5720938f



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