Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/fix location url #195

Merged
merged 2 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pool/app/message_template/message_template.ml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ let location_params
=
let open Pool_location in
let location_url =
id
|> Id.value
|> Format.asprintf "experiments/%s"
|> to_absolute_path layout
id |> Id.value |> Format.asprintf "location/%s" |> to_absolute_path layout
in
let location_link = Human.link_with_default ~default:location_url location in
let location_details = Human.detailed language location in
Expand Down
18 changes: 9 additions & 9 deletions pool/routes/routes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ module Public = struct
;;

let routes =
let locations =
let open Handler.Contact.Location in
let specific =
let files = [ choose ~scope:(add_key Field.File) [ get "" asset ] ] in
[ get "" show; choose ~scope:"/files" files ]
in
[ choose ~scope:(add_key Field.Location) specific ]
in
Handler.Public.(
choose
~middlewares:
Expand All @@ -60,6 +68,7 @@ module Public = struct
; get "/custom/assets/index.css" index_css
; get "/credits" credits
; get "/privacy-policy" privacy_policy
; choose ~scope:Field.(Location |> human_url) locations
]
; choose
~middlewares:
Expand Down Expand Up @@ -126,14 +135,6 @@ module Contact = struct
; choose ~scope:(build_scope "sessions") sessions
]
in
let locations =
let specific =
let open Location in
let files = [ choose ~scope:(add_key Field.File) [ get "" asset ] ] in
[ get "" show; choose ~scope:"/files" files ]
in
[ choose ~scope:(add_key Field.Location) specific ]
in
[ get "/user/personal-details" UserProfile.personal_details
; get "/user/login-information" UserProfile.login_information
; get "/user/contact-information" UserProfile.contact_information
Expand All @@ -146,7 +147,6 @@ module Contact = struct
; post "/user/phone/reset" UserProfile.reset_phone_verification
; post "/user/phone/resend-token" UserProfile.resend_token
; choose ~scope:"/experiments" experiments
; choose ~scope:Field.(Location |> human_url) locations
]
in
[ choose
Expand Down