Update Photos API

Since there is a body to the photos api it should be a post for now.
Also updated the response to separate files and directories.
This commit is contained in:
Cameron Cordes
2020-07-09 18:22:03 -04:00
parent e0e12dcc7b
commit 78c066b7be
3 changed files with 34 additions and 9 deletions

View File

@@ -9,7 +9,9 @@ pub fn list_files(dir: PathBuf) -> io::Result<Vec<PathBuf>> {
.filter(|entry| is_image_or_video(&entry.path()) || entry.file_type().unwrap().is_dir())
.map(|entry| entry.path())
.map(|path: PathBuf| {
let relative = path.strip_prefix(dotenv::var("BASE_PATH").unwrap()).unwrap();
let relative = path
.strip_prefix(dotenv::var("BASE_PATH").unwrap())
.unwrap();
relative.to_path_buf()
})
.collect::<Vec<PathBuf>>();