aglinxinyuan commented on code in PR #4138:
URL: https://github.com/apache/texera/pull/4138#discussion_r2650036236
##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala:
##########
@@ -712,18 +712,31 @@ class WorkflowResource extends LazyLogging {
}
@GET
- @Path("/owner_user")
- def getOwnerUser(@QueryParam("wid") wid: Integer): User = {
+ @Path("/owner_info")
+ @Produces(Array(MediaType.APPLICATION_JSON))
+ def getOwnerInfo(
+ @QueryParam("wid") wid: Integer,
+ @QueryParam("fields") fields: java.util.List[String] // e.g.
&fields=name&fields=...
+ ): User = {
+
+ val allowedFields = Map(
+ "name" -> USER.NAME
+ )
+
+ val requestedFields =
+ Option(fields)
+ .map(_.asScala.toList)
+ .getOrElse(List("name"))
+ .map(_.trim.toLowerCase)
+ .filter(_.nonEmpty)
+ .distinct
+
+ val selectedFields = requestedFields.map { field =>
Review Comment:
Ditto. If there’s a plan to support additional fields, that should be done
in a separate PR. This PR should remain simple and only return the name.
--
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]