actually return file paths in FileSystem::save

This commit is contained in:
2025-07-29 15:22:32 +02:00
parent 77be84da65
commit 45368dcc9a
2 changed files with 21 additions and 7 deletions

View File

@@ -167,12 +167,10 @@ impl FileSystem {
) -> anyhow::Result<Vec<AbsoluteFilePath>> {
let base_path = self.get_target_path(path);
let paths = Vec::new();
let mut paths = Vec::new();
while let Ok(Some(mut upload_file)) = stream.try_next().await {
// TODO: Refactor this result question mark chain thing
let file_name_as_path: RelativeFilePath =
FilePath::new(upload_file.file_name().as_str())?.try_into()?;
let file_name_as_path = RelativeFilePath::from_str(upload_file.file_name().as_str())?;
let file_path = base_path.join(&file_name_as_path);
let mut file = fs::OpenOptions::new()
@@ -184,6 +182,8 @@ impl FileSystem {
while let Ok(Some(chunk)) = upload_file.try_next().await {
file.write(&chunk).await?;
}
paths.push(path.clone().join(&file_name_as_path));
}
Ok(paths)