[cli] secondary sort of routes list by method

parent 0603ffb7
Pipeline #7555 failed with stages
in 63 minutes and 35 seconds
...@@ -19,7 +19,7 @@ import Gargantext.Prelude ...@@ -19,7 +19,7 @@ import Gargantext.Prelude
import Options.Applicative import Options.Applicative
import Servant.API import Servant.API
import Servant.API.Routes import Servant.API.Routes
import Servant.API.Routes.Internal.Route (routePath) import Servant.API.Routes.Internal.Route (routeMethod, routePath)
import Servant.API.WebSocket qualified as WS (WebSocketPending) import Servant.API.WebSocket qualified as WS (WebSocketPending)
import Servant.Auth qualified as Servant import Servant.Auth qualified as Servant
...@@ -56,7 +56,7 @@ routesCLI = \case ...@@ -56,7 +56,7 @@ routesCLI = \case
CLIR_list CLIR_list
-> do -> do
let routes = getRoutes @(NamedRoutes API) let routes = getRoutes @(NamedRoutes API)
let cmpFunc r = renderPath (r ^. routePath) let cmpFunc r = (renderPath (r ^. routePath), r ^. routeMethod)
let sortedRoutes = sortBy (\a b -> compare (cmpFunc a) (cmpFunc b)) routes let sortedRoutes = sortBy (\a b -> compare (cmpFunc a) (cmpFunc b)) routes
traverse_ (T.putStrLn . renderRoute) sortedRoutes traverse_ (T.putStrLn . renderRoute) sortedRoutes
(CLIR_export filePath) (CLIR_export filePath)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment