feat: add store_item_digest_value function to common.rs
This commit is contained in:
@@ -90,3 +90,20 @@ pub fn get_format_box_chars_no_border_line_separator() -> TableFormat {
|
||||
.padding(1, 1)
|
||||
.build()
|
||||
}
|
||||
|
||||
pub fn store_item_digest_value(
|
||||
conn: &mut Connection,
|
||||
item: &Item,
|
||||
digest_type: &str,
|
||||
digest_value: &str,
|
||||
) -> Result<()> {
|
||||
// Save digest to meta
|
||||
let digest_meta_name = get_digest_type_meta(DigestType::from_str(digest_type)?);
|
||||
let digest_meta = Meta {
|
||||
id: item.id.unwrap(),
|
||||
name: digest_meta_name,
|
||||
value: digest_value.to_string(),
|
||||
};
|
||||
store_meta(conn, digest_meta)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user