summaryrefslogtreecommitdiff
path: root/makima/src/daemon/api/contract.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/daemon/api/contract.rs')
-rw-r--r--makima/src/daemon/api/contract.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/makima/src/daemon/api/contract.rs b/makima/src/daemon/api/contract.rs
index 119c0ba..6ba9e51 100644
--- a/makima/src/daemon/api/contract.rs
+++ b/makima/src/daemon/api/contract.rs
@@ -376,9 +376,9 @@ impl ApiClient {
params.push("worktrees=true".to_string());
}
let query = params.join("&");
- let result = self.get(&format!("/api/v1/contracts/cleanup?{}", query)).await?;
+ let result: JsonValue = self.get(&format!("/api/v1/contracts/cleanup?{}", query)).await?;
serde_json::from_value(result.0)
- .map_err(|e| ApiError::Other(format!("Failed to parse cleanup preview: {}", e)))
+ .map_err(|e| ApiError::Parse(format!("Failed to parse cleanup preview: {}", e)))
}
/// Archive completed/failed contracts older than the threshold.
@@ -393,9 +393,9 @@ impl ApiClient {
status_filter: Some(vec!["completed".to_string(), "failed".to_string()]),
dry_run: Some(dry_run),
};
- let result = self.post("/api/v1/contracts/batch", &req).await?;
+ let result: JsonValue = self.post("/api/v1/contracts/batch", &req).await?;
serde_json::from_value(result.0)
- .map_err(|e| ApiError::Other(format!("Failed to parse archive response: {}", e)))
+ .map_err(|e| ApiError::Parse(format!("Failed to parse archive response: {}", e)))
}
/// Delete archived contracts older than the threshold.
@@ -410,9 +410,9 @@ impl ApiClient {
status_filter: Some(vec!["archived".to_string()]),
dry_run: Some(dry_run),
};
- let result = self.post("/api/v1/contracts/batch", &req).await?;
+ let result: JsonValue = self.post("/api/v1/contracts/batch", &req).await?;
serde_json::from_value(result.0)
- .map_err(|e| ApiError::Other(format!("Failed to parse delete response: {}", e)))
+ .map_err(|e| ApiError::Parse(format!("Failed to parse delete response: {}", e)))
}
/// Clean up orphaned worktrees.
@@ -423,9 +423,9 @@ impl ApiClient {
status_filter: None,
dry_run: Some(dry_run),
};
- let result = self.post("/api/v1/contracts/batch", &req).await?;
+ let result: JsonValue = self.post("/api/v1/contracts/batch", &req).await?;
serde_json::from_value(result.0)
- .map_err(|e| ApiError::Other(format!("Failed to parse worktree cleanup response: {}", e)))
+ .map_err(|e| ApiError::Parse(format!("Failed to parse worktree cleanup response: {}", e)))
}
/// List contracts with filtering options.