summaryrefslogtreecommitdiff
path: root/lib/handlers.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlers.ml')
-rw-r--r--lib/handlers.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/handlers.ml b/lib/handlers.ml
index 27ca0b6..f4a7d7b 100644
--- a/lib/handlers.ml
+++ b/lib/handlers.ml
@@ -1,10 +1,12 @@
+open Lwt.Syntax
+
let ogit_root _req = Views.ogit_root () |> Dream_html.respond
let repo_summary req =
let repo_path = Dream.param req "repo_name" in
- let%lwt branches_result = Git_helpers.all_branches repo_path in
- let%lwt commits_result = Git_helpers.latest_commits repo_path 10 in
- match (branches_result, commits_result) with
+ let* branches = Git_helpers.all_branches repo_path
+ and* commits = Git_helpers.latest_commits repo_path 10 in
+ match (branches, commits) with
| Ok branches, Ok commits ->
Views.repo_summary repo_path ~branches ~commits |> Dream_html.respond
| Error msg, _ | _, Error msg -> Views.error_page msg |> Dream_html.respond
Copyright 2019--2025 Marius PETER