Fixed file upload
This commit is contained in:
@@ -81,7 +81,7 @@ async fn get_picture(auth: JwtAuth) -> HttpResponse {
|
||||
return ResponseError::error_response(&err);
|
||||
}
|
||||
};
|
||||
if let Some(path) = user.profile {
|
||||
if let Some(path) = user.profile_picture {
|
||||
match get_file(&path).await {
|
||||
Ok(bytes) => return HttpResponse::Ok().body(bytes),
|
||||
Err(err) => {
|
||||
@@ -98,7 +98,7 @@ async fn get_picture(auth: JwtAuth) -> HttpResponse {
|
||||
async fn delete_picture(auth: JwtAuth) -> HttpResponse {
|
||||
match QueryUser::get_by_email(&auth.user.email) {
|
||||
Ok(user) => {
|
||||
match user.profile {
|
||||
match user.profile_picture {
|
||||
Some(path) => {
|
||||
match delete_file(&path).await {
|
||||
Ok(_) => {
|
||||
|
||||
Reference in New Issue
Block a user