1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-02-16 22:12:39 +00:00

Complete previous commit

This commit is contained in:
Pierre HUBERT 2020-06-25 10:21:27 +02:00
parent 96f3217db4
commit 63c792d497
2 changed files with 2 additions and 2 deletions

View File

@ -326,7 +326,7 @@ impl HttpRequestHandler {
// Determine image destination // Determine image destination
let target_user_data_folder = prepare_file_creation(self.user_id()?, folder)?; let target_user_data_folder = prepare_file_creation(&self.user_id()?, folder)?;
let target_file_path = generate_new_user_data_file_name(target_user_data_folder.as_path(), "png")?; let target_file_path = generate_new_user_data_file_name(target_user_data_folder.as_path(), "png")?;
let target_sys_path = user_data_path(target_file_path.as_path()); let target_sys_path = user_data_path(target_file_path.as_path());

View File

@ -27,7 +27,7 @@ pub fn user_data_path(uri: &Path) -> PathBuf {
/// ///
/// This function returns the relative folder path in user data directory where the file can be /// This function returns the relative folder path in user data directory where the file can be
/// created /// created
pub fn prepare_file_creation(user_id: UserID, folder: &str) -> ResultBoxError<PathBuf> { pub fn prepare_file_creation(user_id: &UserID, folder: &str) -> ResultBoxError<PathBuf> {
let subfolder = match user_id.id() { let subfolder = match user_id.id() {
0 => Path::new(folder).to_path_buf(), 0 => Path::new(folder).to_path_buf(),
id => Path::new(folder).join(to_string(&id)?) id => Path::new(folder).join(to_string(&id)?)