feature/tagging #16
@@ -5,7 +5,7 @@ use actix_web::{
|
|||||||
};
|
};
|
||||||
use chrono::{Duration, Utc};
|
use chrono::{Duration, Utc};
|
||||||
use jsonwebtoken::{encode, EncodingKey, Header};
|
use jsonwebtoken::{encode, EncodingKey, Header};
|
||||||
use log::{debug, error};
|
use log::{error, info};
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@@ -36,7 +36,7 @@ pub async fn login<D: UserDao>(
|
|||||||
creds: Json<LoginRequest>,
|
creds: Json<LoginRequest>,
|
||||||
user_dao: web::Data<Mutex<D>>,
|
user_dao: web::Data<Mutex<D>>,
|
||||||
) -> HttpResponse {
|
) -> HttpResponse {
|
||||||
debug!("Logging in: {}", creds.username);
|
info!("Logging in: {}", creds.username);
|
||||||
|
|
||||||
let mut user_dao = user_dao.lock().expect("Unable to get UserDao");
|
let mut user_dao = user_dao.lock().expect("Unable to get UserDao");
|
||||||
|
|
||||||
|
|||||||
@@ -39,12 +39,6 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
|||||||
|
|
||||||
return dao
|
return dao
|
||||||
.get_files_with_tag_ids(tag_ids.clone())
|
.get_files_with_tag_ids(tag_ids.clone())
|
||||||
.map(|tagged_file| {
|
|
||||||
tagged_file
|
|
||||||
.iter()
|
|
||||||
.map(|photo_name| photo_name.clone())
|
|
||||||
.collect()
|
|
||||||
})
|
|
||||||
.context(format!("Failed to files with tag_ids: {:?}", tag_ids))
|
.context(format!("Failed to files with tag_ids: {:?}", tag_ids))
|
||||||
.map(|tagged_files| {
|
.map(|tagged_files| {
|
||||||
HttpResponse::Ok().json(PhotosResponse {
|
HttpResponse::Ok().json(PhotosResponse {
|
||||||
|
|||||||
Reference in New Issue
Block a user