Delete send history for workspace

This commit is contained in:
Gregory Schier
2024-10-17 11:17:27 -07:00
parent d0b59a0fb4
commit c8342fb0a9
7 changed files with 103 additions and 33 deletions

View File

@@ -509,7 +509,7 @@ pub async fn get_grpc_connection<R: Runtime>(
Ok(stmt.query_row(&*params.as_params(), |row| row.try_into())?)
}
pub async fn list_grpc_connections<R: Runtime>(
pub async fn list_grpc_connections_for_workspace<R: Runtime>(
mgr: &impl Manager<R>,
workspace_id: &str,
) -> Result<Vec<GrpcConnection>> {
@@ -573,6 +573,16 @@ pub async fn delete_all_grpc_connections<R: Runtime>(
Ok(())
}
pub async fn delete_all_grpc_connections_for_workspace<R: Runtime>(
window: &WebviewWindow<R>,
workspace_id: &str,
) -> Result<()> {
for r in list_grpc_connections_for_workspace(window, workspace_id).await? {
delete_grpc_connection(window, &r.id).await?;
}
Ok(())
}
pub async fn upsert_grpc_event<R: Runtime>(
window: &WebviewWindow<R>,
event: &GrpcEvent,
@@ -1433,7 +1443,17 @@ pub async fn delete_all_http_responses_for_request<R: Runtime>(
Ok(())
}
pub async fn list_http_responses<R: Runtime>(
pub async fn delete_all_http_responses_for_workspace<R: Runtime>(
window: &WebviewWindow<R>,
workspace_id: &str,
) -> Result<()> {
for r in list_http_responses_for_workspace(window, workspace_id, None).await? {
delete_http_response(window, &r.id).await?;
}
Ok(())
}
pub async fn list_http_responses_for_workspace<R: Runtime>(
mgr: &impl Manager<R>,
workspace_id: &str,
limit: Option<i64>,