update breakage response type (#642)

This commit is contained in:
Lucy C
2021-10-11 15:13:23 -06:00
committed by Aiden McClelland
parent 3f30905786
commit 6dcddafcd4
4 changed files with 4 additions and 16 deletions

View File

@@ -230,10 +230,7 @@ pub async fn set_dry(
.configured() .configured()
.put(&mut tx, &true) .put(&mut tx, &true)
.await?; .await?;
Ok(BreakageRes { Ok(BreakageRes(breakages))
patch: tx.abort().await?,
breakages,
})
} }
pub async fn set_impl( pub async fn set_impl(

View File

@@ -111,10 +111,7 @@ pub async fn stop_dry(
let mut breakages = BTreeMap::new(); let mut breakages = BTreeMap::new();
stop_common(&mut tx, &id, &mut breakages).await?; stop_common(&mut tx, &id, &mut breakages).await?;
Ok(BreakageRes { Ok(BreakageRes(breakages))
breakages,
patch: tx.abort().await?,
})
} }
pub async fn stop_impl(ctx: RpcContext, id: PackageId) -> Result<WithRevision<()>, Error> { pub async fn stop_impl(ctx: RpcContext, id: PackageId) -> Result<WithRevision<()>, Error> {

View File

@@ -323,10 +323,7 @@ pub struct TaggedDependencyError {
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "kebab-case")]
pub struct BreakageRes { pub struct BreakageRes(pub BTreeMap<PackageId, TaggedDependencyError>);
pub patch: DiffPatch,
pub breakages: BTreeMap<PackageId, TaggedDependencyError>,
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Dependencies(pub BTreeMap<PackageId, DepInfo>); pub struct Dependencies(pub BTreeMap<PackageId, DepInfo>);

View File

@@ -142,10 +142,7 @@ pub async fn uninstall_dry(
break_all_dependents_transitive(&mut tx, &id, DependencyError::NotInstalled, &mut breakages) break_all_dependents_transitive(&mut tx, &id, DependencyError::NotInstalled, &mut breakages)
.await?; .await?;
Ok(BreakageRes { Ok(BreakageRes(breakages))
breakages,
patch: tx.abort().await?,
})
} }
pub async fn uninstall_impl(ctx: RpcContext, id: PackageId) -> Result<WithRevision<()>, Error> { pub async fn uninstall_impl(ctx: RpcContext, id: PackageId) -> Result<WithRevision<()>, Error> {