Notify user whether uploaded images are saved
This commit is contained in:
parent
dad0f282c6
commit
8b0b07a367
3 changed files with 58 additions and 4 deletions
|
|
@ -2,6 +2,7 @@ use std::{fs, io::Cursor};
|
|||
|
||||
use anyhow::{Context, anyhow, bail};
|
||||
use axum::{
|
||||
Json,
|
||||
extract::{Multipart, State},
|
||||
http::StatusCode,
|
||||
response::{IntoResponse, Response},
|
||||
|
|
@ -169,3 +170,14 @@ pub async fn post(server: State<Server>, mut multipart: Multipart) -> somehow::R
|
|||
server.print_typst(typst).await?;
|
||||
Ok(().into_response())
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct Info {
|
||||
originals: bool,
|
||||
}
|
||||
|
||||
pub async fn get(server: State<Server>) -> impl IntoResponse {
|
||||
Json(Info {
|
||||
originals: server.originals.is_some(),
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue