[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
import Options.Applicative
import Servant.API
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.Auth qualified as Servant
......@@ -56,7 +56,7 @@ routesCLI = \case
CLIR_list
-> do
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
traverse_ (T.putStrLn . renderRoute) sortedRoutes
(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