chore: move image stuff to axum-image

This commit is contained in:
trisua 2025-08-24 12:08:13 -04:00
parent dbed2b2457
commit e8cc541f45
15 changed files with 48 additions and 244 deletions

View file

@ -6,7 +6,7 @@ use tetratto_core::model::{oauth, ApiReturn, Error};
pub async fn delete_request(
jar: CookieJar,
Extension(data): Extension<State>,
Path(id): Path<usize>,
Path((bucket, id)): Path<(String, usize)>,
) -> impl IntoResponse {
let data = &(data.read().await).0;
let user = match get_user_from_token!(jar, data, oauth::AppScope::UserManageUploads) {
@ -14,7 +14,7 @@ pub async fn delete_request(
None => return Json(Error::NotAllowed.into()),
};
let upload = match data.2.get_upload_by_id(id).await {
let upload = match data.2.get_upload_by_id_bucket(id, &bucket).await {
Ok(x) => x,
Err(e) => return Json(Error::MiscError(e.to_string()).into()),
};
@ -23,7 +23,7 @@ pub async fn delete_request(
return Json(Error::NotAllowed.into());
}
match data.2.delete_upload(id).await {
match data.2.delete_upload_with_bucket(id, &bucket).await {
Ok(_) => Json(ApiReturn {
ok: true,
message: "Upload deleted".to_string(),