about summary refs log tree commit diff
path: root/src/database/file
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2021-09-27 15:37:14 +0300
committerVika <vika@fireburn.ru>2021-09-27 15:37:14 +0300
commit5d635d9e9ae466ca52d1923fafdc74487030e975 (patch)
treeb5b5ca77c56dfb608f0ca93c8d3dc125957289ed /src/database/file
parentf39927559a42187b9d0c1d25e3c07ea7ea95d395 (diff)
downloadkittybox-5d635d9e9ae466ca52d1923fafdc74487030e975.tar.zst
Implemented FileStorage::delete_post
Diffstat (limited to 'src/database/file')
-rw-r--r--src/database/file/mod.rs5
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> {