use Int64.of_string_opt
This commit is contained in:
parent
af355249fc
commit
412a95613c
1 changed files with 3 additions and 3 deletions
|
|
@ -234,12 +234,12 @@ let keys req server _env =
|
|||
let* last_issue_date =
|
||||
match Vif.Queries.get req "last_issue_date" with
|
||||
| [] -> Ok None
|
||||
| v :: _ -> (
|
||||
match int_of_string_opt v with
|
||||
| s :: _ -> (
|
||||
match Int64.of_string_opt s with
|
||||
| None ->
|
||||
Error
|
||||
"invalid `?last_issue_date` query param, int_of_string failure"
|
||||
| Some n -> Ok (Some (Time.Timestamp.of_s (Int64.of_int n))))
|
||||
| Some n -> Ok (Some (Timestamp.of_s n)))
|
||||
in
|
||||
let* v = mk_keys ~db_conn keys ~last_issue_date in
|
||||
let s = Api.encode_exn jsont v in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue