This commit is contained in:
fengchuanhn@gmail.com
2026-05-25 01:15:42 +08:00
parent d4e017bd6d
commit 940eeb96ef
6 changed files with 98 additions and 47 deletions

View File

@@ -87,7 +87,12 @@ impl MaterialStore {
.await
}
pub async fn delete(&self, id: i64) -> Result<Option<String>, String> {
pub async fn get(&self, id: i64) -> Result<Option<MaterialRecord>, String> {
self.with_db(move |db| db.get(id).map_err(|e| e.to_string()))
.await
}
pub async fn delete(&self, id: i64) -> Result<bool, String> {
self.with_db(move |db| db.delete(id).map_err(|e| e.to_string()))
.await
}