Update affected users revision on cipher and folder change

This commit is contained in:
Miroslav Prasil
2018-08-21 17:31:01 +01:00
parent 4f58d07c83
commit 2b2401be19
3 changed files with 45 additions and 3 deletions

View File

@@ -71,6 +71,7 @@ use db::schema::{folders, folders_ciphers};
/// Database methods
impl Folder {
pub fn save(&mut self, conn: &DbConn) -> bool {
User::update_uuid_revision(&self.user_uuid, conn);
self.updated_at = Utc::now().naive_utc();
match diesel::replace_into(folders::table)
@@ -82,6 +83,7 @@ impl Folder {
}
pub fn delete(self, conn: &DbConn) -> QueryResult<()> {
User::update_uuid_revision(&self.user_uuid, conn);
FolderCipher::delete_all_by_folder(&self.uuid, &conn)?;
diesel::delete(