mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-08-05 10:39:07 +00:00
Cipher::save() should return QueryResult instead of bool
This commit is contained in:
parent
7112c86471
commit
380cf06211
2 changed files with 12 additions and 8 deletions
|
@ -151,16 +151,14 @@ impl Cipher {
|
|||
user_uuids
|
||||
}
|
||||
|
||||
pub fn save(&mut self, conn: &DbConn) -> bool {
|
||||
pub fn save(&mut self, conn: &DbConn) -> QueryResult<()> {
|
||||
self.update_users_revision(conn);
|
||||
self.updated_at = Utc::now().naive_utc();
|
||||
|
||||
match diesel::replace_into(ciphers::table)
|
||||
diesel::replace_into(ciphers::table)
|
||||
.values(&*self)
|
||||
.execute(&**conn) {
|
||||
Ok(1) => true, // One row inserted
|
||||
_ => false,
|
||||
}
|
||||
.execute(&**conn)
|
||||
.and(Ok(()))
|
||||
}
|
||||
|
||||
pub fn delete(&self, conn: &DbConn) -> QueryResult<()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue