💄 Reduce indentation in Database::rejoin_room

This commit is contained in:
Max Brunsfeld 2022-12-20 17:16:56 -08:00
parent cb8962691a
commit 6a2066af6c

View file

@ -1376,8 +1376,9 @@ impl Database {
.exec(&*tx)
.await?;
if participant_update.rows_affected == 0 {
Err(anyhow!("room does not exist or was already joined"))?
} else {
return Err(anyhow!("room does not exist or was already joined"))?;
}
let mut reshared_projects = Vec::new();
for reshared_project in &rejoin_room.reshared_projects {
let project_id = ProjectId::from_proto(reshared_project.project_id);
@ -1413,9 +1414,7 @@ impl Database {
.await?;
project_collaborator::Entity::update(project_collaborator::ActiveModel {
connection_id: ActiveValue::set(connection.id as i32),
connection_server_id: ActiveValue::set(ServerId(
connection.owner_id as i32,
)),
connection_server_id: ActiveValue::set(ServerId(connection.owner_id as i32)),
..host.into_active_model()
})
.exec(&*tx)
@ -1574,7 +1573,6 @@ impl Database {
reshared_projects,
},
))
}
})
.await
}