research_topics::create: bag 8 args into a NewTopic struct (fixes clippy)
ci / gates (push) Successful in 6s
ci / frontend (push) Successful in 26s
ci / rust (push) Failing after 2m37s
ci / e2e (push) Has been skipped
ci / publish (push) Has been skipped

The prior signature took (pool, workspace_id, title, description,
outcome_kind, topology_kind, repo_id, created_by) — 8 args, one
over the clippy::too_many_arguments ceiling and blocking CI.

Refactor to a NewTopic<'a> input struct mirroring the NewLoop /
NewSubTopology pattern the codebase already uses. Wizard-side
additions like a repo commit branch land as struct fields
instead of cascading into every call site.
This commit is contained in:
Omar Sobh
2026-07-09 03:52:59 -07:00
parent 3465bb7a6d
commit 7984e65174
3 changed files with 49 additions and 38 deletions
+9 -7
View File
@@ -368,13 +368,15 @@ pub async fn create_topic(
let id = cm_db::repo::research_topics::create(
&state.pool,
user.workspace_id.as_uuid(),
body.title.trim(),
body.description.trim(),
&body.outcome_kind,
topology_kind,
repo_id,
user.user_id.as_uuid(),
cm_db::repo::research_topics::NewTopic {
workspace_id: user.workspace_id.as_uuid(),
title: body.title.trim(),
description: body.description.trim(),
outcome_kind: &body.outcome_kind,
topology_kind,
repo_id,
created_by: user.user_id.as_uuid(),
},
)
.await?;