use pp_print_list and improve code cleanliness

This commit is contained in:
Swrup 2022-01-14 13:23:45 +01:00
parent e262401fa9
commit 3bcc3dcefa
4 changed files with 71 additions and 85 deletions

View file

@ -79,7 +79,7 @@ module Marker = struct
Jv.to_string
(Jv.call board_div "getAttribute" [| Jv.of_string "boardvalue" |])
in
let link = "/" ^ board ^ "/" ^ thread_id in
let link = Format.sprintf "/%s/%s" board thread_id in
ignore @@ Jv.set thread_link "href" (Jv.of_string link);
ignore @@ Jv.set thread_link "innerText" (Jv.of_string "[View Thread]");
()
@ -118,9 +118,8 @@ module Marker = struct
(Jv.call board_div "getAttribute" [| Jv.of_string "boardvalue" |])
in
let window = Jv.get Jv.global "window" in
let fetchfutur =
Jv.call window "fetch" [| Jv.of_string ("/" ^ board ^ "/markers") |]
in
let link = Jv.of_string (Format.sprintf "/%s/markers" board) in
let fetchfutur = Jv.call window "fetch" [| link |] in
ignore @@ Jv.call fetchfutur "then" [| Jv.repr markers_handle_response |];
()
end