actually return file paths in FileSystem::save
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user