Fixed file upload

This commit is contained in:
Benjamin Sherriff
2023-10-24 08:42:21 -04:00
parent f3eff8e310
commit ece4154b4e
7 changed files with 41 additions and 30 deletions

View File

@@ -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(_) => {