add: ability to manage uploads
This commit is contained in:
parent
6fabb38c10
commit
eb95be0f38
11 changed files with 234 additions and 48 deletions
|
@ -8,7 +8,7 @@ use crate::{
|
|||
State,
|
||||
image::{Image, save_buffer},
|
||||
get_user_from_token,
|
||||
routes::api::v1::auth::images::{MAXIUMUM_FILE_SIZE, read_image},
|
||||
routes::api::v1::auth::images::{MAXIMUM_FILE_SIZE, read_image},
|
||||
};
|
||||
|
||||
/// Get a community's avatar image
|
||||
|
@ -135,7 +135,7 @@ pub async fn upload_avatar_request(
|
|||
);
|
||||
|
||||
// check file size
|
||||
if img.0.len() > MAXIUMUM_FILE_SIZE {
|
||||
if img.0.len() > MAXIMUM_FILE_SIZE {
|
||||
return Json(Error::DataTooLong("image".to_string()).into());
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ pub async fn upload_banner_request(
|
|||
);
|
||||
|
||||
// check file size
|
||||
if img.0.len() > MAXIUMUM_FILE_SIZE {
|
||||
if img.0.len() > MAXIMUM_FILE_SIZE {
|
||||
return Json(Error::DataTooLong("image".to_string()).into());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue