Ready to implement photos management
This commit is contained in:
@ -5,6 +5,8 @@ use crate::extractors::member_extractor::FamilyAndMemberInPath;
|
||||
use crate::models::{Member, MemberID, Sex};
|
||||
use crate::services::members_service;
|
||||
use crate::utils::countries_utils;
|
||||
use actix_multipart::form::tempfile::TempFile;
|
||||
use actix_multipart::form::MultipartForm;
|
||||
use actix_web::{web, HttpResponse};
|
||||
|
||||
serde_with::with_prefix!(prefix_birth "birth_");
|
||||
@ -292,3 +294,17 @@ pub async fn delete(m: FamilyAndMemberInPath) -> HttpResult {
|
||||
members_service::delete(&m).await?;
|
||||
Ok(HttpResponse::Ok().finish())
|
||||
}
|
||||
|
||||
#[derive(Debug, MultipartForm)]
|
||||
pub struct UploadPhotoForm {
|
||||
#[multipart(rename = "photo")]
|
||||
photo: TempFile,
|
||||
}
|
||||
|
||||
/// Upload a new photo for a user
|
||||
pub async fn set_photo(
|
||||
_m: FamilyAndMemberInPath,
|
||||
MultipartForm(_form): MultipartForm<UploadPhotoForm>,
|
||||
) -> HttpResult {
|
||||
todo!()
|
||||
}
|
||||
|
Reference in New Issue
Block a user