Compare commits
1 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
4055d3843a | 3 years ago |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -0,0 +1,25 @@
|
||||
use actix_web::{body::BoxBody, Responder, HttpRequest, http::header::ContentType, HttpResponse};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Page {
|
||||
pub domain: String,
|
||||
pub domain_name: String,
|
||||
pub page: String,
|
||||
pub page_name: String,
|
||||
pub page_text: String,
|
||||
pub parent_domain: String,
|
||||
pub parent_page: String,
|
||||
}
|
||||
|
||||
impl Responder for Page {
|
||||
type Body = BoxBody;
|
||||
|
||||
fn respond_to(self, _req: &HttpRequest) -> HttpResponse<Self::Body> {
|
||||
let res_body = serde_json::to_string(&self).unwrap();
|
||||
|
||||
HttpResponse::Ok()
|
||||
.content_type(ContentType::json())
|
||||
.body(res_body)
|
||||
}
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
|
||||
function normalizeName(pagename) {
|
||||
return str.normalize("NFKD").replace(/\p{Diacritic}/gu, "").toLowerCase().replace(/œ/g, "oe").replace(/æ/g, "ae").replace(/\s+/g, "_").replace(/[^a-z0-9_]/g, "").replace(/_+/g, "_");
|
||||
}
|
||||
|
||||
export { normalizeName };
|
||||
Loading…
Reference in new issue