Move to "show pretty" currently a dupe of 'show'.

This commit is contained in:
2023-03-02 09:33:48 -08:00
parent 369e88880a
commit c33f901f48
3 changed files with 76 additions and 20 deletions

View File

@@ -32,6 +32,15 @@ async fn search(
Ok(Json(res))
}
#[get("/show/<query>/pretty")]
async fn show_pretty(
nm: &State<Notmuch>,
query: &str,
) -> Result<Json<ThreadSet>, Debug<NotmuchError>> {
let res = nm.show(query)?;
Ok(Json(res))
}
#[get("/show/<query>")]
async fn show(nm: &State<Notmuch>, query: &str) -> Result<Json<ThreadSet>, Debug<NotmuchError>> {
let res = nm.show(query)?;
@@ -110,7 +119,15 @@ async fn main() -> Result<(), Box<dyn Error>> {
let _ = rocket::build()
.mount(
"/",
routes![original_part, original, hello, search_all, search, show],
routes![
original_part,
original,
hello,
search_all,
search,
show_pretty,
show
],
)
.attach(cors)
.manage(Notmuch::default())