carloea2 commented on code in PR #8151:
URL: https://github.com/apache/texera/pull/8151#discussion_r3937733894


##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/DashboardResource.scala:
##########
@@ -152,28 +152,23 @@ object DashboardResource {
     searchQueryParams.orderBy match {
       case pattern(column, order) =>
         val field = getColumnField(column)
-        field match {
-          case Some(value) =>
-            List(order match {
-              case "Asc"  => value.asc()
-              case "Desc" => value.desc().nullsLast()
-            })
-          case None => List()
-        }
-      case _ => List() // Default case if the orderBy string doesn't match the 
pattern
+        List(order match {
+          case "Asc"  => field.asc()
+          case "Desc" => field.desc().nullsLast()
+        })
+      case _ => throw new BadRequestException(s"Unknown orderBy: 
${searchQueryParams.orderBy}")
     }
   }
 
   // Helper method to map column names to actual database fields based on 
resource type

Review Comment:
   Corrected the helper comment and listed all accepted orderBy values.



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