mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
update breakage response type (#642)
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
@@ -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> {
|
||||||
|
|||||||
@@ -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>);
|
||||||
|
|||||||
@@ -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> {
|
||||||
|
|||||||
Reference in New Issue
Block a user