Allow searching from custom_domain
This commit is contained in:
parent
92fbd174eb
commit
8e7f789969
@ -202,6 +202,7 @@ Then try to restart Plume
|
|||||||
routes![
|
routes![
|
||||||
routes::blogs::custom_details,
|
routes::blogs::custom_details,
|
||||||
routes::blogs::custom_activity_details,
|
routes::blogs::custom_activity_details,
|
||||||
|
routes::search::custom_search,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
.mount(
|
.mount(
|
||||||
|
@ -49,8 +49,7 @@ macro_rules! param_to_query {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/search?<query..>")]
|
fn search_guts(query: Option<Form<SearchQuery>>, rockets: PlumeRocket) -> Ructe {
|
||||||
pub fn search(query: Option<Form<SearchQuery>>, rockets: PlumeRocket) -> Ructe {
|
|
||||||
let conn = &*rockets.conn;
|
let conn = &*rockets.conn;
|
||||||
let query = query.map(Form::into_inner).unwrap_or_default();
|
let query = query.map(Form::into_inner).unwrap_or_default();
|
||||||
let page = query.page.unwrap_or_default();
|
let page = query.page.unwrap_or_default();
|
||||||
@ -83,3 +82,17 @@ pub fn search(query: Option<Form<SearchQuery>>, rockets: PlumeRocket) -> Ructe {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[get("/search?<query..>")]
|
||||||
|
pub fn search(query: Option<Form<SearchQuery>>, rockets: PlumeRocket) -> Ructe {
|
||||||
|
search_guts(query, rockets)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[get("/<_custom_domain>/search?<query..>")]
|
||||||
|
pub fn custom_search(
|
||||||
|
_custom_domain: String,
|
||||||
|
query: Option<Form<SearchQuery>>,
|
||||||
|
rockets: PlumeRocket,
|
||||||
|
) -> Ructe {
|
||||||
|
search_guts(query, rockets)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user