remove duplicate when matching multipart form
This commit is contained in:
parent
8f5322a645
commit
0369de541c
1 changed files with 2 additions and 16 deletions
|
|
@ -166,7 +166,6 @@ let newthread_post ~board request =
|
||||||
| None -> render_unsafe "Not logged in" request
|
| None -> render_unsafe "Not logged in" request
|
||||||
| Some nick -> (
|
| Some nick -> (
|
||||||
match%lwt Dream.multipart request with
|
match%lwt Dream.multipart request with
|
||||||
(*TODO jpp du duplicat la *)
|
|
||||||
| `Ok
|
| `Ok
|
||||||
[ ("alt", [ (_, alt) ])
|
[ ("alt", [ (_, alt) ])
|
||||||
; ("file", file)
|
; ("file", file)
|
||||||
|
|
@ -175,15 +174,7 @@ let newthread_post ~board request =
|
||||||
; ("subject", [ (_, subject) ])
|
; ("subject", [ (_, subject) ])
|
||||||
; ("tags", [ (_, tags) ])
|
; ("tags", [ (_, tags) ])
|
||||||
; ("threadComment", [ (_, comment) ])
|
; ("threadComment", [ (_, comment) ])
|
||||||
]
|
] -> (
|
||||||
| `Ok
|
|
||||||
(("alt", [ (_, alt) ])
|
|
||||||
:: ("file", file)
|
|
||||||
:: ("lat_input", [ (_, lat) ])
|
|
||||||
:: ("lng_input", [ (_, lng) ])
|
|
||||||
:: ("subject", [ (_, subject) ])
|
|
||||||
:: ("tags", [ (_, tags) ])
|
|
||||||
:: ("threadComment", [ (_, comment) ]) :: _ :: _ ) -> (
|
|
||||||
match (Float.of_string_opt lat, Float.of_string_opt lng) with
|
match (Float.of_string_opt lat, Float.of_string_opt lng) with
|
||||||
| None, _ -> render_unsafe "Invalide coordinate" request
|
| None, _ -> render_unsafe "Invalide coordinate" request
|
||||||
| _, None -> render_unsafe "Invalide coordinate" request
|
| _, None -> render_unsafe "Invalide coordinate" request
|
||||||
|
|
@ -241,12 +232,7 @@ let reply_post request =
|
||||||
; ("file", file)
|
; ("file", file)
|
||||||
; ("replyComment", [ (_, comment) ])
|
; ("replyComment", [ (_, comment) ])
|
||||||
; ("tags", [ (_, tags) ])
|
; ("tags", [ (_, tags) ])
|
||||||
]
|
] -> (
|
||||||
| `Ok
|
|
||||||
(("alt", [ (_, alt) ])
|
|
||||||
:: ("file", file)
|
|
||||||
:: ("tags", [ (_, tags) ])
|
|
||||||
:: ("replyComment", [ (_, comment) ]) :: _ :: _ ) -> (
|
|
||||||
let parent_id = Dream.param "thread_id" request in
|
let parent_id = Dream.param "thread_id" request in
|
||||||
let res =
|
let res =
|
||||||
match file with
|
match file with
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue