Notify user whether uploaded images are saved

This commit is contained in:
Joscha 2025-04-09 14:59:27 +02:00
parent dad0f282c6
commit 8b0b07a367
3 changed files with 58 additions and 4 deletions

View file

@ -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(),
})
}