diff options
author | Vika <vika@fireburn.ru> | 2021-09-27 15:37:14 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2021-09-27 15:37:14 +0300 |
commit | 5d635d9e9ae466ca52d1923fafdc74487030e975 (patch) | |
tree | b5b5ca77c56dfb608f0ca93c8d3dc125957289ed /src | |
parent | f39927559a42187b9d0c1d25e3c07ea7ea95d395 (diff) | |
download | kittybox-5d635d9e9ae466ca52d1923fafdc74487030e975.tar.zst |
Implemented FileStorage::delete_post
Diffstat (limited to 'src')
-rw-r--r-- | src/database/file/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/database/file/mod.rs b/src/database/file/mod.rs index 9e33f0b..dff527f 100644 --- a/src/database/file/mod.rs +++ b/src/database/file/mod.rs @@ -322,7 +322,10 @@ impl Storage for FileStorage { } async fn delete_post<'a>(&self, url: &'a str) -> Result<()> { - todo!() + let path = url_to_path(&self.root_dir, url); + if let Err(e) = async_std::fs::remove_file(path).await { + Err(e.into()) + } else { Ok(()) } } async fn get_setting<'a>(&self, setting: &'a str, user: &'a str) -> Result<String> { |